8

In Apache 2.4 you can reverse proxy an HTTP connection to a local Unix socket with: [1]

ProxyPass unix:/path/to/app.sock|http://example.com/app/name

You can reverse proxy a WebSocket connection to a local TCP socket with: [2]

ProxyPass ws://127.0.0.1:12345/app/name

But how can you reverse proxy a WebSocket connection to a Unix socket? [☹]

0

1 Answer 1

4

Ok I got it, once you have mod_proxy and mod_proxy_wstunnel enabled you can do this:

ProxyPass /ws/ unix:/path/to/app.sock|ws://example.com/ws/

It works well for me since I only expect to establish a ws connection on the /ws endpoint.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.