Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

should disconnect socket after invalid message in outbound mode #11

Open
davehorton opened this issue Jan 30, 2018 · 0 comments
Open

should disconnect socket after invalid message in outbound mode #11

davehorton opened this issue Jan 30, 2018 · 0 comments
Assignees

Comments

@davehorton
Copy link
Owner

When an invalid or corrupt message is received on the tcp socket in outbound mode, it is almost always a spammer or misdirected http request. Curerntly the socket is not being closed by drachtio -- it should be immediately closed and discarded. The logs below show an example where the socket is not closed.

Mon, 29 Jan 2018 06:30:44 GMT drachtio:socket _initServer: added socket: 62160:3002, count now: 1
{"level":50,"time":1517207444879,"msg":"uncaughtException: Error: invalid message from server, did not start with length#: \u0003\u0000\u0000+&�\u0000\u0000\u0000\u0000\u0000Cookie: mstshash=hello\r\n\u0001\u0000\b\u0000\u0003\u0000\u0000\u0000","pid":621,"hostname":"drachtio-group-staging-ds65","v":1}
Error: invalid message from server, did not start with length#: ^C^@^@+&�^@^@^@^@^@Cookie: mstshash=hello^M
^A^@^H^@^C^@^@^@
    at WireProtocol._onData (/usr/local/src/node-srs/node_modules/drachtio/lib/wire-protocol.js:238:19)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    at TCP.onread (net.js:547:20)
Mon, 29 Jan 2018 07:04:39 GMT drachtio:socket _initServer: added socket: 51187:3002, count now: 2
{"level":50,"time":1517209479050,"msg":"uncaughtException: Error: invalid message from server, did not start with length#: \u0003\u0000\u0000+&�\u0000\u0000\u0000\u0000\u0000Cookie: mstshash=hello\r\n\u0001\u0000\b\u0000\u0003\u0000\u0000\u0000","pid":621,"hostname":"drachtio-group-staging-ds65","v":1}
Error: invalid message from server, did not start with length#: ^C^@^@+&�^@^@^@^@^@Cookie: mstshash=hello^M
^A^@^H^@^C^@^@^@
    at WireProtocol._onData (/usr/local/src/node-srs/node_modules/drachtio/lib/wire-protocol.js:238:19)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    at TCP.onread (net.js:547:20)
Mon, 29 Jan 2018 07:33:33 GMT drachtio:socket _initServer: added socket: 61943:3002, count now: 3
{"level":50,"time":1517211213321,"msg":"uncaughtException: Error: invalid message from server, did not start with length#: \u0003\u0000\u0000+&�\u0000\u0000\u0000\u0000\u0000Cookie: mstshash=hello\r\n\u0001\u0000\b\u0000\u0003\u0000\u0000\u0000","pid":621,"hostname":"drachtio-group-staging-ds65","v":1}
Error: invalid message from server, did not start with length#: ^C^@^@+&�^@^@^@^@^@Cookie: mstshash=hello^M
^A^@^H^@^C^@^@^@
    at WireProtocol._onData (/usr/local/src/node-srs/node_modules/drachtio/lib/wire-protocol.js:238:19)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    at TCP.onread (net.js:547:20)
Mon, 29 Jan 2018 07:39:21 GMT drachtio:socket _initServer: added socket: 60040:3002, count now: 4
@davehorton davehorton self-assigned this Jan 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant