2 ms·
I'm not sure if understanding HTTP/1.1 is enough to bridge a websocket connection between client and backend websocket server. However, there is a 3rd party tcp
by moonboots 14y ago
I'm not sure if understanding HTTP/1.1 is enough to bridge a websocket connection between client and backend websocket server. However, there is a 3rd party tcp proxy module for nginx that allows proxying websockets:
https://github.com/yaoweibin/nginx_tcp_proxy_module https://github.com/yaoweibin/nginx_tcp_proxy_module
- Argorak 14y agoIf you use TCP proxying, you have no way to react on HTTP headers. So either your Websocket server runs on a different port or interface or you have to proxy _all_ traffic on that port to your websocket backend.
- pornel 14y agoWebSockets aren't HTTP — fake header is not enough to fool HTTP-compliant servers/proxies. You could try HTTPS WebSockets with TLS 1.1 SNI vhosts. I recommend using Server-Sent Events instead. You get nearly same API for realtime server->client push, and they're HTTP-compatible: http://html5doctor.com/server-sent-events/ http://html5doctor.com/server-sent-events/ http://speakerdeck.com/u/pornel/p/server-sent-events http://speakerdeck.com/u/pornel/p/server-sent-events