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.

Error: unexpected server response (404)

See original GitHub issue

I am trying to connect to PubNub using a websocket, just like the example here but with node: https://www.pubnub.com/websockets/

The example code works fine in the browser, but using ws I get:

Error: unexpected server response (404)
    at ClientRequest.response (/Users/dennybritz/node_modules/ws/lib/WebSocket.js:719:15)
    at Object.onceWrapper (events.js:316:30)
    at emitOne (events.js:115:13)
    at ClientRequest.emit (events.js:210:7)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:565:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:116:23)
    at TLSSocket.socketOnData (_http_client.js:454:20)
    at emitOne (events.js:115:13)
    at TLSSocket.emit (events.js:210:7)
    at addChunk (_stream_readable.js:266:12)

Any idea what could be going wrong here? Any workaround?

Issue Analytics

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

github_iconTop GitHub Comments

github_iconTop Results From Across the Web

WebSocket handshake: Unexpected response code: 404
Am writing my first websocket program and am getting "WebSocket handshake: Unexpected response code: 404", error while loading the webpage.
Read more >
404 Not Found Error: What It Is and How to Fix It
The 404 Not Found Error is an HTTP response status code, which indicates that the requested resource could not be found. Like most...
Read more >
Error during WebSocket handshake: Unexpected response code
when I put old server url, the url was working, But when I put new server url, the url appeared as "404" with...
Read more >
Help with Error during WebSocket handshake: Unexpected ...
Help with Error during WebSocket handshake: Unexpected response code: 404 ... I can't seem to get by this, would anyone have any guidance?...
Read more >
The server responded with a status code of 404 (UniFi ...
Unexpected Error : The server responded with a status code of 404 (UniFi Video 3.2.2) ... We've run across a problem with 3.2.2....
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