N
N
Newto2020-10-18 03:59:58
Socket.io
Newto, 2020-10-18 03:59:58

How to hide Socket.IO port in browser address bar?

I have a Socket.IO server, it spins on port 3000.
At mysite.ru:3000/urlpart/urlpart1 there is a page interacting with the server.

The question is: how to make it so that when visiting mysite.ru/urlpart/urlpart1 (the same address as indicated above, but without specifying the port), Socket.IO would see it and work correctly with it?

Googled for a very long time, but so far I could not find a solution to the issue. I dug in the direction of mode_rewrite (I have apache), mocked up something like RewriteRule ^urlpart/urlpart1/(.*)$ mysite.ru:3000/urlpart/urlpar1t/$1 [QSA,L] in htaccess, but such an instruction when entering addresses mysite.ru/urlpart/urlpart1 simply redirects to the same one with port 3000, while changing the address in the address bar, respectively.

Tell me, please, who knows the solution to the problem.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Gavrilov, 2020-10-18
@Newto

Proxying with nginx or apache

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question