# Websocket-client onopen event

**URL:** <https://discourse.nodered.org/t/websocket-client-onopen-event/11321>\
**Category:** General\
**Created:** [20 May 2019 12:03 UTC](https://discourse.nodered.org/t/websocket-client-onopen-event/11321 "2019-05-20T12:03:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pmbsa](https://avatars.discourse-cdn.com/v4/letter/p/2bfe46/32.png) [@pmbsa](https://discourse.nodered.org/u/pmbsa)\
**Post date:** [20 May 2019 12:03 UTC](https://discourse.nodered.org/t/websocket-client-onopen-event/11321/1 "2019-05-20T12:03:41Z")

</div>

Hi, I was just wondering if anybody has a solution to providing a token to the web socket server "onopen". I have a wio node that publishes PIR events over was but requires a token from the client when the connection opens.

thanks  
Paul

---

<div class="post-metadata">

**Author:** ![pmbsa](https://avatars.discourse-cdn.com/v4/letter/p/2bfe46/32.png) [@pmbsa](https://discourse.nodered.org/u/pmbsa)\
**Post date:** [20 May 2019 14:20 UTC](https://discourse.nodered.org/t/websocket-client-onopen-event/11321/2 "2019-05-20T14:20:46Z")

</div>

In case anybody finds it useful, it seems the simplest solution is to inject the access token into a websocket out node first and then the websocket in node works just fine.

I followed this example ([WIO example](https://community.seeedstudio.com/WIO-Link-and-Node-RED-websockets-p-1716.html)) the only difference between my solution and the one on the post is I inject the token after 0.5 seconds of the flow starting so I don't have to do it manually. I also repeat the injection regularly in case there was a disconnect. not sure thats needed but I am doing it anyway.

thanks  
Paul

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [20 May 2019 15:26 UTC](https://discourse.nodered.org/t/websocket-client-onopen-event/11321/3 "2019-05-20T15:26:55Z")

</div>

This is a small world indeed. [I published an article about that in a blog back in June, 2016.](http://node-red.blogspot.com/2016/06/wio-link-and-node-red-websockets.html)

I see now that someone copy/pasted the results to the Seeed forum a month later.

This is the power of sharing. One day the knowledge will be useful for someone.

It also remembers me that I have not tested many of the groove modules yet. Overall I like the WIO platform or at least liked 3 years ago. I don´t know if it is still alive.
