-
Notifications
You must be signed in to change notification settings - Fork 1k
Websocketd behind Apache (2.4.x)
If using Apache 2.4.x you can use modproxy_wstunnel to configure a path to point to websocketd on the same port as your server.
First, enable modproxy and modproxy_wstunnel in your Apache configuration. For Debian/Ubuntu you can use:
sudo a2enmod proxy
sudo a2enmod proxy_wstunnel
Then, add these lines to your site's configuration
ProxyRequests Off
ProxyPass "<path>/" "ws://localhost:<port>/"
ProxyPassReverse "<path>/" "ws://localhost:<port>/"
Where "path" is the path for the URL (eg. "/ws/app") and "port" is the port the websocketd instance is listening on.
Restart Apache and you should be able to use "ws://your_domain/path" to connect to your application.
If you are using SSL you can add the same lines above to your site configuration but include the line...
SSLProxyEngine On
...before the "ProxyRequests" line. You can then use "wss:" instead of "ws:".
- You will not be able to access the development console (--devconsole), you will need to write your own client code for testing.
- If you didn't have modproxy installed before, you must ensure "ProxyRequests Off" is applied to all hosts - you do not want to be running an open proxy!
- You can block the port websocketd is running on to external connections via your firewall - useful if you only want access via HTTPS.
The websocketd user guide is a publicly editable wiki. Please contribute!
Getting Started
Reference
Language specific
Advanced: Internals
Spanish Websocket Wiki
Primeros pasos
Referencia
Lenguajes
Avanzado