Networking
152 verified issues
http://socket.io website is down
http://socket.io website is down. Many people on social network are reporting the same.
Error during WebSocket handshake: Unexpected response code: 400
Can't find out a solution, I get this error on the browser console: WebSocket connection to 'ws://.../socket.io/?EIO=2&transport=websocket&sid=p3af7ZNfvogtq6tAAAG0' failed: Error during WebSocket handshake: Unexpected response code: 400. Hava any advice ?
NPM audit reports the package with high vulnerability (Denial of Service)
More info https://www.npmjs.com/advisories/1486
Make Socket.IO great again
(yep, that headline is overrused) Disclaimer: - I have no control over the website (socket.io), to my knowledge only @rauchg has, so I'm unfortunately not able to fix those issues: https://github.com/socketio/socket.io/issues/2807 https://github.com/socketio/socket.io/issues/2791 https://github.com/socketio/socket.io/issues/2781 https://github.com/socketio/socket.io/issues/2773 https://github.com/socketio/socket.io/issues/2753 https://github.com/socketio/socket.io/issues/2743 https://github.com/socketio/socket.io/issues/2736 - I have no control over the chat example repository, that is the one that is behind the chat example, so I'm unfortunately not able to fix those issues: https://github.com/socketio/socket.io/issues/2821 (and all open PR over there) - I'm not even an expert in Socket.IO, just a developer digging around during his free time between two freelance contracts Now, enough about my limitations. The Server API and Client API were added on Github, do not hesitate if you find something missing! Current to-do list: - [x] release the version `2.0` of Engine.IO Engine.IO will now default to uws as WebSocket engine, that should bring great performance improvements. An important issue about double UTF-8 encoding was also fixed in the parser. The only "problem" is that one of the numerous issues open could need a fix over there, hence the delay. - [ ] complete the API docs (missing methods, code examples...): https://github.com/socketio/socket.io/issues/2350#issuecomm
Continual βtransport closeβ on client
I've setup socket.io v.1.4.5 w express and I have been unable to trace the reason for unexplainable disconnects on the clients. The reason given by the disconnect event on the client is "transport close." It happens very consistently on some clients. Is there any explanation for a client getting "transport close" disconnects on what seems to be a timed interval? The client reconnects just fine but it causes extreme inconvenience because it happens so frequently. I've tried various settings, like changing the pingInterval, pingTimeout and the port for websockets (I am now using port 80). But no matter what I seem to do, the problem never goes away.
xhr.abort on disconnect not sending connection close to server on beforeunload event
Is any body else running into this issue? Here is the scenario: 1. We are running node/socket.io on a separate server with its own DNS/domainname (Don't ask why) and our application server is on a different host/DNS/domainname. 2. The socket.io.js file is rendered from the node server. 3. When a user navigates away from a page we would like to send a disconnect event to the server from client. (Should be pretty easy right?) 4. Upon debugging we found that on line 3436 in socket.io.js an xhr.abort command is issued which should tell the server to initiate a disconnect event. (But no dice). 5. The disconnect finally fires but not from the unload event, but from the connection timeout. 6. Seems pretty simple, anyone else having these issues? Thanks.
Add support for caching
Support for caching would be an awesome addition. Something along the lines of nginx location ~\* .(jpg|png|gif|jpeg|css|js|mp3|wav|swf|mov|doc|pdf|xls|ppt|docx|pptx|xlsx)$ { proxy_buffering on; proxy_cache_valid 200 120m; expires 864000; }
Changing headers should be an option
changing the headers "location" & "origin" when proxying websocket request should be an option, because this is important to make the proxying behave like "not happened".
Support Hybi10 binaryType
Just landed in Chromium: http://code.google.com/p/chromium/issues/detail?id=93652 Allows sending Blob or ArrayBuffer (binary data).
io configure - socket io v1.X
What is the example configuration for do this in socket io v1.X.X ? [code block]
reconnect_failed gets never fired
If I stop the node server so every reconnect of the client fails, the reconnect_failed event gets never fired Here is the position in the code where reconnect_failed should get fired https://github.com/LearnBoost/socket.io-client/blob/master/lib/socket.js#L501 for some reason it never enters the else part
Socket.io disconnect with ping timeout randomly
we have a real time chat application, that uses socket.io, node.js, mongodb etc. Chat is working very fine except one issue & that is as follows Some time in between while chatting user are getting disconnected with ping timeout. As I checked there was no problem with internet connection & also there is no logs on re-connection attempts. It directly gets disconnected. OS - Ubuntu 14.04/AWS EC2 socket.io version on server - 1.6.0 Node version - v0.10.25 Please let us know what could be the problem. Also let me know if you need any other details
host sub domain
This simple proxy server <pre> var httpProxy = require('http-proxy'); httpProxy.createServer(function (req, res, proxy) { var options = { host: "localhost", port: 5984 }; proxy.proxyRequest(req, res, options); }).listen(5000); </pre> if i change host:"localhost" to host:"subdomain.domainoninternet.com" if get 'Host not found' back, is this the "www . host" issue? https://github.com/nodejitsu/node-http-proxy/issues/150 on a related question, is there a way to set request headers before they are sent to destination? (to set Auth headers from the server) thank you
crash in accessing res.connection.pair
Hi, I am using the latest http-proxy in hostNameOnly mode and it kept crashing in https://github.com/nodejitsu/node-http-proxy/blob/master/lib/node-http-proxy.js#L372 I dont' have the stack trace right now, but it said something like res.connection was undefined. . I just changed res to req in that line and everything started to work. I am very new to nodejs, so not sure what may be happening, but is this just a typo? I would think you would use the request object to set the header on the proxied request, so it does seem like one. Regards Qasim
There needs to be a wildcard feature in event handling
Note: The 'anything' event in docs can be confused as a global event, but of course isnt. There should exist something to the effect of: [code block] See: http://stackoverflow.com/questions/10405070/socket-io-client-respond-to-all-events-with-one-handler http://stackoverflow.com/questions/32552155/how-do-i-handle-all-incoming-socket-events-rather-than-a-specific-one http://stackoverflow.com/questions/32552481/did-the-socket-io-global-event-end-up-in-release?noredirect=1#comment52961409_32552481 Because there's no support for this, developers are having to modify Socket.io client side (note, the node.js patch for this is not applicable client side) with code like this: [code block]
io.of(nsp).to(room).emit('test',{testdata: 1}); not being received
Hey, running 1.4.5 and when I try to emit an event triggered from a REST API call to a room, the connected sockets in the room aren't receiving the event debug mode shows it's sending as the following as undefined/driver/v1 +4ms My current work around is to find each socket in the room and emit the event to each socket
High rate of "client not handshaken should reconnect"
I am running a chat server with node.js / socket.io and have a lot of "client not handshaken" warnings. In the peak time there are around 1.000 to 3.000 open TCP connections. For debugging purposes I plotted the graph of actions succeeding the server-side "set close timeout" event, because the warnings are always preceded by those, so the format is: <pre> Mon Aug 01 2011 08:16:01 GMT+0200 (CEST) debug - set close timeout for client 2098080741242069807 Mon Aug 01 2011 08:16:01 GMT+0200 (CEST) debug - xhr-polling closed due to exceeded duration -- Mon Aug 01 2011 08:16:01 GMT+0200 (CEST) debug - set close timeout for client 330973265416677743 Mon Aug 01 2011 08:16:01 GMT+0200 (CEST) debug - setting request GET /socket.io/1/xhr-polling -- Mon Aug 01 2011 08:16:01 GMT+0200 (CEST) debug - set close timeout for client 10595896332140683620 Mon Aug 01 2011 08:16:01 GMT+0200 (CEST) debug - cleared close timeout for client 10595896332140683620 -- Mon Aug 01 2011 08:16:01 GMT+0200 (CEST) debug - set close timeout for client 21320636051749821863 Mon Aug 01 2011 08:16:01 GMT+0200 (CEST) debug - cleared close timeout for client 21320636051749821863 -- Mon Aug 01 2011 08:16:01 GMT+0200 (CEST) debug - set close timeout for client 3331715441803393577 Mon Aug 01 2011 08:16:01 GMT+0200 (CEST) warn - client not handshaken client should reconnect </pre> The following plot explained: - x axis: The passed time between the first and last seeing of a client id. - y axis: total
Error: socket hang up
I'm getting errors that look like this happening every hour or two, causing systemd to restart my nodeProxyServer.js script: [code block] May it be related to node-http-proxy, or something else?
Error with nodejs 0.10.8
I get this warning with each simple socket.io app I make: warn - websocket parser error: reserved fields must be empty Any clue how I can fix this?
Websockets dont work with a router
I'm not sure if this is a bug or not but websockets wont work with a proxy table e.g [code block] It works fine proxying web requests. But websockets don't work. If I access the site directly it does work (with websockets) I also unsuccessfully tried adding in [code block] It also looks like `server.on('upgrade` doesn't fire. In addition, even without the above event. If there are attempts to use websockets (after a while). The below error will appear: [code block] After a while it will run out of memory and crash.
socket.emit inside socket.on function
Note: for support questions, please use one of these channels: stackoverflow or slack You want to: [ ] report a bug [x] request a feature Current behaviour invoke a socket.emit inside a socket.on function does not work. (see code below) ` socket.on('notification', function (data) { socket.emit('news', { hello: 'world' }); });` Steps to reproduce (if the current behaviour is a bug) Server side, emit a message from inside a "socket.on" method. Expected behaviour Message sent to client Setup - OS: Archlinux - browser: Firefox - socket.io version: 1.7.2 Other information (e.g. stacktraces, related issues, suggestions how to fix)
Changing query parameter issue
I am hoping I can get some direction on this. Initializing the io with io(url,opts) works with the query parameter. If that query parameter needs to change you can dot into the sio.io.opts object. However, after it is changed that way, it is not able to be changed again. Iteration 0 - Works On Initialization <code> socket = io(options.socket,{query: {_accessToken: 'cow'} }); </code> Server's socket.request._query._accessToken returns 'cow' Iteration 1 -Works When changed the first time <code> socket.io.opts.query._accessToken = 'moo'; </code> Server's socket.request._query._accessToken returns 'moo' Iteration 2 - Doesn't work anymore <code> socket.io.opts.query._accessToken = 'twomoos'; </code> Server's socket.request._query._accessToken returns 'moo'' Although it seems to change on the client side, the server still returns the value of the access token in Iteration 1. Doing some digging, I found that the <code> socket.io.engine.transport.ws </code> contains the URL for the request, but keeps the _accessToken as the iteration 1 variable. <code> ws://192.168.1.8/socket.io/?_accessToken=moo&transport=websocket&sid=mY9rC4km7ASypgDTAAAI </code> I can't change the variable using javascript because it still stays the same. That also seems rather hacky and I'd like to not do that. I haven't put in an issue request for anything, so I hope this counts as a legitimate one.
unusual behavior when proxying websocket to socket.io
I'm not really sure how to explain so I whipped up some code to demonstrate. https://gist.github.com/967964 please run that, then open 3 (console-supporting) browsers at http://localhost:8000 (i hope to find something to simulate in the future) hit send in each (you may need to modify node-http-proxy to not change headers) console will log msgs rcvd from server. then open 3 more browsers at http://localhost:9000 (no proxy) hit send in each notice the output is different. also, the server output is different. when proxied, messages are duplicated for client X depending on the number of clients connected after X. also, connections disconnect after some time when proxied while they remain open indefinitely when not proxied. [code block]
socket.io crashes Mobile Safari on iOS
I am having an issue with Mobile Safari crashing on iOS. The following will consistently reproduce a crash for me: 1. Load a page in Mobile Safari that connects using socket.io. 2. Click the "change tab" button and navigate to a different tab to put the current tab in the background. 3. Send a message from the server to the client. 4. Navigate back to the original tab (the one that connected via socket.io). Mobile Safari crashes. I think it is related to this: https://gist.github.com/2052006 The page above includes a workaround, but I'm not sure how to implement this workaround with socket.io.
Target specific client on clustered socket.io server and using acknowledgment callback
I've clustered my socket.io server and I'm looking for a way to emit to a specific client and receiving a acknowledgment callback. The problem that the server doesn't have a reference to a instance of the target client, because this client can be connected to another socket.io server instance (because it's clustered). I know I can emit to a room named after the the socket.id or a custom room where I put the client in. But the problem is that this is considered broadcasting and then I can't use a acknowledgment callback. I don't want to add complexity to the target client. The target client should just be able to call the callback. I see two possible solutions: - Find a way to create a fake socket instance with the socket.id (so I can use existing callback code) - Broadcast to a room and build my own callback system, see: https://github.com/Automattic/socket.io/issues/1656#issuecomment-49077695 A fake socket instance wouldn't actually have a connection to a client, but I hope to use it's emit function, have it talk to it's adapter (socket.io-redis) and have it receive the acknowledgment callback. Any tips on these solutions, maybe something I should also consider.
Cannot find name 'TransformStream' after updating to v5.2.0
Since I updated `socket.io` from the `v4.7.1` to the `v4.7.2` (and so `engine.io-parser` from the `v5.1.0` to the `v5.2.1`), I'm getting the following errors while building my projects: [code block] Funnily, I'm only getting this error when compiling using `tsc` but not when compiling using `esbuild`. `npx tsc` -> error `npx esbuild src/index.ts --platform=node` -> ok Here is my `tsconfig.json`: [code block] Reading nodejs's documentation, when using `TransformStream`, it looks like they are importing it with [code block] which is not the case for `engine.io-parser`, so maybe that's the problem.
Duplicate events
Here I create primitive example of server with socket.io with such stuff: - socket.io > 0.9.9 [code block] - node -v > v0.8.7 - https://github.com/Balloon/elephant.io _on x86_64 Linux_: Distributor ID: Ubuntu Description: Ubuntu 12.04.1 LTS Release: 12.04 Codename: precise Kernel: 3.2.0-29-generic GCC version: 4.6 (x86_64-linux-gnu) [code block] And PHP-client like this: [code block] Here is the log of that server: [code block] So, every time php-client sends one message or emits event, it's duplicated on the server side :(
not compatible with node v0.6
This is what I get when I try to install it via npm <pre> npm ERR! Unsupported npm ERR! Not compatible with your version of node/npm: http-proxy@0.7.6 npm ERR! Required: {"node":"0.4.x || 0.5.x"} npm ERR! Actual: {"npm":"1.0.105","node":"0.6.2"} npm ERR! npm ERR! System Linux 3.1.1-1-ARCH npm ERR! command "node" "/usr/bin/npm" "install" npm ERR! cwd /home/pita/yammercode/etherpad-lite-router npm ERR! node -v v0.6.2 npm ERR! npm -v 1.0.105 npm ERR! code ENOTSUP npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /home/pita/yammercode/etherpad-lite-router/npm-debug.log npm not ok </pre>
Cannot read property 'protocol' of undefined
README has this example for custom application logic (for caronte tree): [code block] I'm getting these errors: [code block] I am running node v0.10.20.
Canot call method 'split' of null
After recent upgrade my tests break: [code block]