You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello all,
I get an issue when simply trying to connect to a server via WebSocket.
Here is my code:
const WebSocket = require('ws');
const ws = new WebSocket('http://172.21.178.165:8080');
ws.on('open', function open() {
ws.send('Start video HoloLens');
});
And I get
Error: socket hang up
at createHangUpError (_http_client.js:331:15)
at Socket.socketOnEnd (_http_client.js:423:23)
at emitNone (events.js:111:20)
at Socket.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1055:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
If I try connecting to the same address with Chrome and socket.io, it works well:
I've attached the result of this connection, you can see that it is working as expected.
Someone has an idea why I get this socket hang up error?
I also tried using this library to have a websocket client but I get a similar error, so I guess I've done something wrong or it's the fault of the library used under the hood to send the initial request or other request that is buggy? Any suggestion is very appreciated :)
NodeJS version 8.9.4
ws version 5.2.0
(request version 2.85.0)
OS: Windows 10
Thanks,
Pierre
The text was updated successfully, but these errors were encountered:
Hello all,
I get an issue when simply trying to connect to a server via WebSocket.
Here is my code:
And I get
If I try connecting to the same address with Chrome and socket.io, it works well:
I've attached the result of this connection, you can see that it is working as expected.
Someone has an idea why I get this socket hang up error?
I also tried using this library to have a websocket client but I get a similar error, so I guess I've done something wrong or it's the fault of the library used under the hood to send the initial request or other request that is buggy? Any suggestion is very appreciated :)
NodeJS version 8.9.4
ws version 5.2.0
(request version 2.85.0)
OS: Windows 10
Thanks,
Pierre
The text was updated successfully, but these errors were encountered: