Open andhapp opened 9 years ago
I am also experiencing the same issue My proxy setting : { "host": "host.abc.com", "port": 9001, "context": "/websocket", "ws": true, "xforward": false, "changeOrigin": true }
Usage : var ws = new WebSocket('ws://localhost:8000/websocket?' + id);
Am I doing any thing wrong here , or is this a reported issue ? Connecting directly to the web socket server works fine.
+1 I am the same here My client use new SockJS('/io') can not connect by websocket on firefox, but work fine on chrome Below my grunt
{
context: '/io',
host: 'localhost',
port: '5000',
ws:true,
changeOrigin: true,
https: false,
xforward: false
}
It works - 0.2.0
@nvcken Does it work for you on version 0.2.0?
yes
@nvcken I tried it with 0.2.0 and I still see the same issue. Could you use the code that I provided in the issue description and see if you could make it work locally? Cheers.
Mine worked after I added changeOrigin: true
. Apparently my server was snipping the connection during handshake.
I am quite new to grunt and node, so please let me know anything obvious that I overlooked. I have a pretty simple set-up as I just wanted to test the proxy to a websocket server, here's the code:
WebSocket server (server.js)
Package.json
Gruntfile.js
All these files are in the same directory. In order to run these files, I do the following:
node server.js
. This starts a websocket server on port 8001.grunt connec:server:keepalive
. This starts a websocket server on port 9000.only to see the following error:
Connecting directly to the websocket server works fine.
Any pointers will be appreciated!
Thanks.