How can I configure an Apache2 connection to a WebSocket proxy connection (for example, BrowserSync) if it is made at the same URL, with the only difference being the "Upgrade: websocket" header and the ws: // URL scheme?
For instance:
HTTP request:
GET http://example.com/browser-sync/socket.io/?... HTTP/1.1
...
WebSocket request:
GET ws://example.com/browser-sync/socket.io/?... HTTP/1.1
Connection: upgrade
Upgrade: websocket
Sec-WebSocket-Version: 13
...
All the examples that I find redirect only one path, for example, "<Location / ws> ..." or "ProxyPass / ws / ws: //example.com/"
My current configuration:
ProxyRequests off
<Location />
ProxyPass http://127.0.0.1:3000/
ProxyPassReverse /
</Location>
mod_proxy, mod_proxy_http and mod_proxy_wstunnel are included.
source
share