A
A
Arseniy2018-05-06 00:09:15
Apache HTTP Server
Arseniy, 2018-05-06 00:09:15

How to do proper websocket proxying?

I recently started migrating chat to my server, which runs on sockets. I ran into a problem that the ws:// protocol does not work on https://. Googled, the answer was the same: "We need to make a proxy." In this case, I do not understand anything at all, so ....
This socket server is working: ws://194.58.121.250:7777
I tried to make a proxy, but nothing came out at all. This is what I wrote in the apache2.conf file:

<VirtualHost *:*>
  ProxyPreserveHost On	
  ProxyPass /websocket ws://194.58.121.250:7777
  ProxyPassReverse /websocket ws://194.58.121.250:7777
</VirtualHost>

Hope someone can help :)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Aksentiev, 2018-05-06
@arsenist

Proxy is not required.
It is enough to listen to wss i.e. attach a domain certificate to the socket server ssl.
And how to do this, you can read in the dock of the module that you use for the socket server.

S
Sergey Levchenko, 2018-05-06
@nuykon

http > ws
https > wss
https://learn.javascript.ru/websockets#wss

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question