0

I want to know how to connect websocket with SSL connection. my apache2 configuration is below:

 ProxyPass /test/fr/pageJsWebsocket/  ws://127.0.0.1:8081/ retry=0 keepalive=On
 ProxyPassReverse /test/fr/pageJsWebsocket/  ws://127.0.0.1:8081/ retry=0

in my client site :

 var conn = new WebSocket ('wss://mydomain.com/test/fr/pageJsWebsocket/')

My configuration looks like:

SSLProxyEngine On
ProxyPreserveHost On
ProxyRequests Off # Websocket proxy
# wss redirects to working ws protocol ProxyPass /testPage/
ws://mydomain.com:8081/web/fr ProxyPassReverse /testPage/
ws://mydomain.com:8081/web/fr

The error I am getting is:

JS file: var conn = new WebSocket ('wss://mydomain.com:8081/web/fr/testPage/') Error: failed: WebSocket opening handshake timed out
Brydenr
  • 798
  • 1
  • 19
  • 30
  • Does this answer your question? [PHP websocket on SSL with proxy\_wsTunnel - Apache](https://stackoverflow.com/questions/42764084/php-websocket-on-ssl-with-proxy-wstunnel-apache) – Brydenr Dec 06 '19 at 16:01
  • Hello, thank you for your response, i have try this configuration i have the same error: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. – Yassine Abida Dec 06 '19 at 16:14
  • Can you include the specific error that you are getting? More detail tends to increase the chance of a good answer. – Brydenr Dec 06 '19 at 16:30
  • i have done this configuration in my appache2 SSLProxyEngine On ProxyPreserveHost On ProxyRequests Off # Websocket proxy # wss redirects to working ws protocol ProxyPass /testPage/ ws://mydomain.com:8081/web/fr ProxyPassReverse /testPage/ ws://mydomain.com:8081/web/fr in JS file: var conn = new WebSocket ('wss://mydomain.com:8081/web/fr/testPage/') Error: failed: WebSocket opening handshake timed out – Yassine Abida Dec 06 '19 at 16:39
  • Putting the config/error information into the question itself can help people see it sooner. I went ahead and added it – Brydenr Dec 06 '19 at 17:52

0 Answers0