# Websocket in and out within the same connection

**URL:** https://discourse.nodered.org/t/websocket-in-and-out-within-the-same-connection/66068
**Category:** General
**Created:** [5 August 2022 11:50 UTC](https://discourse.nodered.org/t/websocket-in-and-out-within-the-same-connection/66068 "2022-08-05T11:50:43Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Tzoreol](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tzoreol/32/65786_2.png) [@Tzoreol](https://discourse.nodered.org/u/Tzoreol)
#### Post date: [5 August 2022 11:50 UTC](https://discourse.nodered.org/t/websocket-in-and-out-within-the-same-connection/66068/1 "2022-08-05T11:50:43Z")

</div>

Hi!

I'm trying to connect Node-RED with OBS websocket. Without authentication this is pretty straigthforward but I'm stuck for the authentication.

According to [OBS websocket documentation](https://github.com/obsproject/obs-websocket/blob/master/docs/generated/protocol.md) there are 3 steps. First, after the initial request from the client, the server send an Hello message. The client should respond with an Identify message and finally the server sends an Identified one.

So I have a websocket in node to catch the Hello message and a websocket out node to send the Identify one. But I see that opens 2 distincts connection so when I'm tring to send the Identify message, it opens a second connection, leading to another Hello message that is never catched.

Is it possible to have the in and out within the same connection?

Thanks

---

<div class="post-metadata">

### Author: ![knoepsche](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knoepsche/32/69450_2.png) [@knoepsche](https://discourse.nodered.org/u/knoepsche)
#### Post date: [5 August 2022 14:33 UTC](https://discourse.nodered.org/t/websocket-in-and-out-within-the-same-connection/66068/2 "2022-08-05T14:33:40Z")

</div>

I did this once with a Ventuz Connection. For this it worked with two nodes: Websocket In, Websocket Out .  
Then I switched them both to the same connection (no listen on!!).  
In my case the connection was like this:

```auto
ws://127.0.0.1:20404/DirectorRemoting_Service/1.0/commands/ws/ 

```

---

<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: [4 October 2022 14:34 UTC](https://discourse.nodered.org/t/websocket-in-and-out-within-the-same-connection/66068/3 "2022-10-04T14:34:40Z")

</div>

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