We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
NodeJS websocket server
var server = require('websocket').server; var http = require('http'); var app = http.createServer(); app.listen(8080, function() { console.log('running on port 8080'); }); var ws = new server({ httpServer: app, autoAcceptConnections: false, keepalive: false, disableNagleAlgorithm: false }); ws.on('request', function(req) { if (req.httpRequest.url.indexOf('/0/session/') === 0) { console.log('new request'); var connection = req.accept('ws', req.origin); connection.on('message', function(message) { if (message.type === 'utf8') { /* Receive integer, send as may bytes as JSON */ var bytes = Number(message.utf8Data); if (!Number.isNaN(bytes)) { console.log('sending ' + bytes + ' bytes of data'); connection.send(new Array(bytes + 1).join('.')); } } }); } });
When asked for + tenth kB (to be defined), client crashes with:
** (FunctionClauseError) no function clause matching in :websocket_client.disconnected/3 (websocket_client 1.4.2) /home/jean/ws_cli_test/deps/websocket_client/src/websocket_client.erl:291: :websocket_client.disconnected(:cast, :connect, {:context, {:websocket_req, :ws, 'localhost', 8080, '/0/session/', 5000, #Reference<0.1445969634.340525062.178319>, 1, #Port<0.10>, {:transport, :gen_tcp, :tcp, :tcp_closed, :tcp_error, [mode: :binary, active: true, packet: 0]}, "zkOLuxAroVzrOKg721ev0Q==", :undefined, 1, :undefined, :undefined, :undefined}, {:transport, :gen_tcp, :tcp, :tcp_closed, :tcp_error, [mode: :binary, active: true, packet: 0]}, [{"Sec-WebSocket-Protocol", "ws"}], {:ws, 'localhost', 8080, '/0/session/'}, {WsCliTest.Socket, %{}}, "", false, 0}) (stdlib 3.15.2) gen_statem.erl:1194: :gen_statem.loop_state_callback/11 (stdlib 3.15.2) proc_lib.erl:226: :proc_lib.init_p_do_apply/3 Initial Call: :websocket_client.init/1 Ancestors: [#PID<0.230.0>, #PID<0.229.0>] Message Queue Length: 0 Messages: [] Links: [#PID<0.230.0>] Dictionary: [] Trapping Exits: false Status: :running Heap Size: 1598 Stack Size: 29 Reductions: 8702
The text was updated successfully, but these errors were encountered:
Fix decoding fragmented frame
02f1306
When receiving fragmented frames, decoding can fail if websocket / TCP fragmentation is aligned for the last frame. Fixes sanmiguel#70
No branches or pull requests
NodeJS websocket server
When asked for + tenth kB (to be defined), client crashes with:
The text was updated successfully, but these errors were encountered: