Page 1 of 1

Nginx and Poker Mavens

Posted: Wed Sep 01, 2021 9:00 pm
by DonnyB
I have Nginx on my main server (main.com), that has proxy forwarding to my Windows server (windows.main.com) that is actually hosting Poker Mavens. I access the proxy by visiting https://main.com/poker, which will proxy tunnel to https://windows.main.com:8087

However, Poker Mavens is still trying to connect the the file port (8088) on main.com, and not windows.main.com:8088. Therefore it has a websocket error as it's trying to access the wrong device. In "Internet IP Address" settings, I have windows.main.com set.

Any way to around this?

Re: Nginx and Poker Mavens

Posted: Wed Sep 01, 2021 9:11 pm
by Kent Briggs
Your proxy server would also have to forward the websocket connection on the packet port in the same way it did with the http connection on the file port. I don't know anything about Nginx but Cloudflare does this automatically when you use their proxy system.

Re: Nginx and Poker Mavens

Posted: Thu Sep 02, 2021 9:23 am
by DonnyB
Is the packet port just another websocket connection? Or a different protocol?

Re: Nginx and Poker Mavens

Posted: Thu Sep 02, 2021 9:56 am
by Kent Briggs
DonnyB wrote:Is the packet port just another websocket connection? Or a different protocol?
It's the only websocket connection. It works like this: the player points their browser to the File Port on your server, making a normal http/https connection that pulls in the player client. That player client gets the server address using window.location.hostname in Javascript and makes a websocket connection to the Packet Port of that address. So if you're forwarding the http/https connection on the file port then you need to do the same for the ws/wss connection on the packet port.

I found this, maybe it will help:

https://www.nginx.com/blog/websocket-nginx/

Re: Nginx and Poker Mavens

Posted: Thu Sep 02, 2021 1:57 pm
by DonnyB
Thanks for your help Kent. This worked great.