Score:0

Different port forwarding for https and wss (Websocket) using firewalld

hu flag

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?

cn flag
Use a proxy (e.g. nginx or trafik) to redirect at a http sub protocol level and to do TLS termination
VIVEK avatar
hu flag
@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!
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.