Fails to connect on port 443

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

amateur
Posts: 29
Joined: 07 Jun 2017, 07:18

Fails to connect on port 443

Postby amateur » 31 Aug 2017, 19:55

Hi unusual problem with ports.

I've been using port 80 and 8443 (SFS 2.13) plus the usual 9933.

I'd like to switch from 8443 to 443 as this is not used by anything else.

If I change this in SmartFox server it starts but the client can't connect (client changed to use 443 as the secure port).

I've tried adjusting ssl.ini settings in start_d and got nowhere, it's like it's hard-coded to 8443.

I should add it's all been working fine with a real ssl certificate, just on the wrong port.

Please help, thanks.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Fails to connect on port 443

Postby Lapo » 01 Sep 2017, 07:59

If the underlying OS is Linux you must be root to use ports below 1024.
I suspect that might be the issue.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
amateur
Posts: 29
Joined: 07 Jun 2017, 07:18

Re: Fails to connect on port 443

Postby amateur » 01 Sep 2017, 08:07

I think I might have cracked it - IIS by default sets the firewall to "System" for port 443. Adding another firewall rule seems to have got it working. Thanks!
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Fails to connect on port 443

Postby Lapo » 01 Sep 2017, 08:27

That explains it :)
Lapo

--

gotoAndPlay()

...addicted to flash games
amateur
Posts: 29
Joined: 07 Jun 2017, 07:18

Re: Fails to connect on port 443

Postby amateur » 01 Sep 2017, 16:50

Right, I think I'm getting somewhere now. Thanks for your help.

What remains is that I'd like to run another service on the same server and using the same port (443). This is for websockets / web not sockets which is working fine on 9933.

I have 2 options:
1) Find a way to force SmartFox / Jetty to only listen on a specific hostname
2) Add another IP address to the server, and then find a way to force SmartFox / Jetty to only listen on a specific IP address

If they don't work then I'll need to set up multiple servers which makes things a bit more complicated.

I have tried reverse proxy options and they don't really do what I want.

What would you recommend?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Fails to connect on port 443

Postby Lapo » 02 Sep 2017, 07:29

Only one service can liste on a TCP port, per network card.
So if you absolutely need two services on the same exact port, two NICs is probably best.

cheers
Lapo

--

gotoAndPlay()

...addicted to flash games
amateur
Posts: 29
Joined: 07 Jun 2017, 07:18

Re: Fails to connect on port 443

Postby amateur » 02 Sep 2017, 07:39

Okay, good. How do I specify which NIC for the embedded webserver in SmartFox to use?

Thanks
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Fails to connect on port 443

Postby Lapo » 02 Sep 2017, 07:53

In this case you will have to manually bind the private IP of the NIC that you want to use.
Let's say the IP is 10.0.0.2

Edit the http.ini file under SFS2X/lib/jetty/start.d/ and add this line:

Code: Select all

jetty.http.host=10.0.0.2

save and restart

For HTTPS you can do the same in the ssl.ini file, with this line:

Code: Select all

jetty.ssl.host=10.0.0.2


cheers
Lapo

--

gotoAndPlay()

...addicted to flash games
amateur
Posts: 29
Joined: 07 Jun 2017, 07:18

Re: Fails to connect on port 443

Postby amateur » 08 Sep 2017, 06:22

All set up and sorted now with SmartFox sharing a port with another service using 2 IP addresses. Thanks for your help.

Return to “SFS2X Questions”

Who is online

Users browsing this forum: IdleChimp and 64 guests