Is there a way to set up the mod_proxy_wstunnel
module on Apache 2.2 on CentOS? I can't upgrade to 2.4 due to project limitations.
I have invested lot of time figuring this out and there is very little documentation available for this. Let me know if this helps, else I can help you troubleshooting the problem. Also hope this helps to future readers.
To compile mod_proxy_wstunnel.so
,
yum install httpd-devel
mod_proxy_wstunnel.c
apxs -i -a -c mod_proxy_wstunnel.c
Now load the above compiled module in /etc/httpd/modules
Copy the mod_proxy_wstunnel.so
in /etc/httpd/modules
(Compiled from above)
In order to load the module while the server starts, use LoadModule
directive in the httpd conf file, /etc/httpd/conf/httpd.conf
Add the following line with all other LoadModule line,
LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
To restart apache, use service httpd restart
To check the loaded modules in apache after restarting use, httpd -M
After the module is installed, Add this two lines in /etc/httpd/conf/httpd.conf
ProxyPass /websockets/mywebsocket ws://mywebsocketserver.com//websockets/mywebsocket retry=4
ProxyPassReverse /websockets/mywebsocket ws://mywebsocketserver.com//websockets/mywebsocket retry=4
Note: Make sure the above lines are added before the default case of /
. Also restart apache just to be safe.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With