0

Currently I setup port forwarding for a nodejs server such that all http requests (using tcp protocol) get redirected from port 80 to 3000, and all https requests (using tcp) get redirected from port 443 to 8080.

The nodejs application also needs to support a websocket server (wss) currently running on port 7071. But the problem is both https and wss use tcp protocol and the default port for both of them is 443. I also can't use the same destination port (8080) for both https server and websocket server.

So, is there any way to distinguish between https and wss requests using firewalld so that I can redirect https requests to 8080 and wss requests to 7071?

2
  • Use a proxy (e.g. nginx or trafik) to redirect at a http sub protocol level and to do TLS termination
    – hardillb
    Commented May 7, 2023 at 20:20
  • @hardillb Could you pls provide more details or share a link where I can find more information on how to do that? I am not experienced with nginx that's why. Thanks!
    – VIVEK
    Commented May 8, 2023 at 2:57

0

You must log in to answer this question.

Browse other questions tagged .