question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

netty server / node.js client - websocket hang up error

See original GitHub issue
  • Version: 5.3.0
  • Platform: Windows 7 Pro SP1 64bit
  • Subsystem:

https://stackoverflow.com/questions/46721436/netty-server-node-js-client-websocket-hang-up-error


- 47 45 54 20 2F 25 37 44 2F 77 73 2F 20 48 54 54 ; GET /%7D/ws/ HTT
- 50 2F 31 2E 31 0D 0A 53 65 63 2D 57 65 62 53 6F ; P/1.1..Sec-WebSo
- 63 6B 65 74 2D 56 65 72 73 69 6F 6E 3A 20 31 33 ; cket-Version: 13
- 0D 0A 53 65 63 2D 57 65 62 53 6F 63 6B 65 74 2D ; ..Sec-WebSocket-
- 4B 65 79 3A 20 57 30 67 77 4E 52 44 4B 4E 76 53 ; Key: W0gwNRDKNvS
- 74 53 73 78 32 68 78 75 79 73 77 3D 3D 0D 0A 43 ; tSsx2hxuysw==..C
- 6F 6E 6E 65 63 74 69 6F 6E 3A 20 55 70 67 72 61 ; onnection: Upgra
- 64 65 0D 0A 55 70 67 72 61 64 65 3A 20 77 65 62 ; de..Upgrade: web
- 73 6F 63 6B 65 74 0D 0A 48 6F 73 74 3A 20 31 32 ; socket..Host: 12
- 37 2E 30 2E 30 2E 31 3A 38 36 38 33 0D 0A 0D 0A ; 7.0.0.1:8683....
const WebSocket = require('ws');
let url = "ws://127.0.0.1:8683/ws";
let ws = new WebSocket(url, {perMessageDeflate: false});
ws.on('open', ()=> { console.log('open'); });
ws.on('message', (msg)=> { console.log('received: '+msg); });
ws.on('error', (error)=> { console.log(error); });
ws.on('close', ()=> { console.log('closed');});

Result:

Error: socket hang up closed

My client websockets implementation in chrome still connects perfectly without problem… this only happens with node sockets.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
lpincacommented, Oct 14, 2017

Closing as the mystery has been solved.

1reaction
donnydarkocommented, Oct 14, 2017

omg I’m so silly let url = ws://${ip}😒{port}}/ws; I had a second } on the url

Read more comments on GitHub >

github_iconTop Results From Across the Web

NodeJS - What does "socket hang up" actually mean?
It means that socket does not send connection end event within the timeout period. If you are getting the request for cheerio via...
Read more >
How to handle a socket hang up error in Node.js usually
Socket hang up error is thrown in two cases. When you are a client & When you are a server/proxy When you, as...
Read more >
Could not get any response socket hang up - Help
I am not able to Post to the server. I am receiving “Could not get any response” error. While checking the logs found...
Read more >
Hang in There! (A solution to socket hang up)
This blog post will go over my process of solving the error and what the actual (and surprisingly/annoyingly) simple solution was. First thing ......
Read more >
Server-side I/O Performance: Node vs. PHP vs. Java vs. Go
Hit it with 20,000 clients concurrently and your server will burst into flames. ... The popular kid on the block when it comes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found