I am running a little website using IIS 7.5 on Windows Server 2008 R2. I've got a node.js application too running on port 3000.
Http calls from the website (client browser) are reverse proxied from
http://example.com/node/*to
http://localhost:3000/*. Everything works fine so far.
The problem is when i try to use socket.io.
I am receiving:
WebSocket connection to 'ws://example.com/socket.io/?EIO=3&transport=websocket&sid=adb9WRpoMFYRoS0vAAAB' failed:Error during WebSocket handshake:Unexpected response code:502
I am pretty sure, if i am not wrong, that:
It does forward the initial request to my server as the initial request to a websocket server is a standard HTTP request (with some additional headers). IIS does know about that and simply forwards the request. However, upon receiving the websocket request the websocket server sends a 101 response and switch into websocket mode. IIS does not understand the websocket traffic and it is not able to proxy that.
Is there a trick or solution to configure the reverse proxy for the ws:// adresses?