-
Notifications
You must be signed in to change notification settings - Fork 5.8k
socket.io doesn't work when "resource" option is specified in client #11419
Comments
Offhand, this sounds like a problem with haproxy (or perhaps even socket.io) rather than PhantomJS. Can socket.io-client support the cc: @guille |
Same problem with me. I am using latest socket.io on server side as well as client side. I remember getting the same 'handshake error' when using old versions of chrome ~13/14 Update: |
@arunkjn Is it appropriate in all cases to remove that check? Could you explain why the check was wrong to be there in the first place? |
@sodabrew I am not sure how this would affect other parts of the code, and what is the real purpose behind this check. Also I am not confident if this can be merged without review from others. All I remember is that the same error used to occur with old webkit (chrome/safari) browsers, at a time when Websockets protocol was still under draft. This was a security concern around cross origin requests and browsers did not entertain proxied request with a non matching path. (thinking of it as a forged request maybe) EDIT: I read this from phantomJS website PhantomJS 2.x will eventually get a WebKit upgrade that has RFC 6455 websockets. |
Due to our very limited maintenance capacity, we need to prioritize our development focus on other tasks. Therefore, this issue will be automatically closed (see #15395 for more details). In the future, if we see the need to attend to this issue again, then it will be reopened. Thank you for your contribution! |
We're using haproxy to forward requests of the form
my.domain:443/special_token/socket.io/1/websocket/
To make this request from the browser, we do:
var socket = io.connect( 'http://my.domain:443', {
'resource': 'special_token',
});
However, we now get the following error.
Error during WebSocket handshake: location mismatch: ws://my.domain:443/special_token/socket.io/1/websocket/8835688411479694001 != ws://my.domain:443/socket.io/1/websocket/8835688411479694001
(which is at
https://github.com/ariya/phantomjs/blob/master/src/qt/src/3rdparty/webkit/Source/WebCore/websockets/WebSocketHandshake.cpp#L601)
I think the wrong location is expected when the "resource" option is specified. Is this right? Sorry in advance for any noobishness on my side
The text was updated successfully, but these errors were encountered: