# Event listener for websocket-in

**URL:** <https://discourse.nodered.org/t/event-listener-for-websocket-in/23933>\
**Category:** General\
**Created:** [31 March 2020 01:45 UTC](https://discourse.nodered.org/t/event-listener-for-websocket-in/23933 "2020-03-31T01:45:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![michaelblight](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/michaelblight/32/445_2.png) [@michaelblight](https://discourse.nodered.org/u/michaelblight)\
**Post date:** [31 March 2020 01:45 UTC](https://discourse.nodered.org/t/event-listener-for-websocket-in/23933/1 "2020-03-31T01:45:32Z")

</div>

The `websocket-in` node emits "opened" and "closed" events. Can I set up a listener to these events in a `function` node, or do I have to write a new node to do so? I tried calling `RED.nodes.getNode()` from within a function, but `nodes` was null.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [30 May 2020 01:58 UTC](https://discourse.nodered.org/t/event-listener-for-websocket-in/23933/2 "2020-05-30T01:58:37Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
