SocketCluster / socketcluster

Highly scalable realtime pub/sub and RPC framework
https://socketcluster.io
MIT License
6.15k stars 314 forks source link

Socket Connect Error: Unknown request #502

Open happilymarrieddad opened 5 years ago

happilymarrieddad commented 5 years ago

Hello, I've been trying to dockerize a really old socketcluster app that we have here and it keeps trying to connect to some other service... I can't find in the code where this is happening. Is there a way to show what endpoint it is trying to connect to? I think if I knew what it was trying to do then it would be a lot easier to diagnosis where this is failing. Thanks!

{ SocketProtocolError: Socket hung up
    at SCClientSocket._onSCClose (/app/node_modules/socketcluster-client/lib/scclientsocket.js:654:15)
    at SCTransport.<anonymous> (/app/node_modules/socketcluster-client/lib/scclientsocket.js:304:12)
    at SCTransport.Emitter.emit (/app/node_modules/component-emitter/index.js:133:20)
    at SCTransport._onClose (/app/node_modules/socketcluster-client/lib/sctransport.js:217:28)
    at WebSocket.SCTransport.wsSocket.onerror (/app/node_modules/socketcluster-client/lib/sctransport.js:81:12)
    at WebSocket.onError (/app/node_modules/socketcluster-client/node_modules/ws/lib/event-target.js:128:16)
    at emitOne (events.js:116:13)
    at WebSocket.emit (events.js:211:7)
    at ClientRequest.req.on (/app/node_modules/socketcluster-client/node_modules/ws/lib/websocket.js:535:10)
    at emitOne (events.js:116:13)
  name: 'SocketProtocolError',
  message: 'Socket hung up',
  code: 1006 }
happilymarrieddad commented 5 years ago

Maybe something like `Attempted to connect to 'some DNS.com' or something like that.

jondubois commented 5 years ago

@happilymarrieddad Socket hung up can also happen on sudden disconnect; not only for failed connect attempts. But I guess it might help to improve the error message to give more details about the host/port.

In the meantime you can use socket.options to check where it was trying to connect. There should the the hostname and port in there.

happilymarrieddad commented 5 years ago

ok cool thanks!