Running the Dedicated Server on Default Ports

In previous sections we set up a dedicated WebSockets server (HyperServer) and tested it with a test application. The dedicated server ran on ports 8077 and 8078 for non-secure and secure connections. Here we run the same server on the default HTTP/HTTPS ports (80 and 443). Some networks prohibit non-standard ports or some clients can't access them, so using standard ports may be necessary.

Below are the steps and configuration changes required to run HyperServer on default ports while keeping IIS running on the same machine.

1

1. Change HyperServer configuration to use default ports

Edit your HyperServer CFG file and set:

[hyper_server]
port=80

In the SSL configuration file set:

SSL.SSLPort = 443

Then run the dedicated HyperServer to see what happens.

2

2. Observe binding failure if IIS is using default ports

If IIS is already listening on ports 80 and 443, HyperServer will be unable to bind to these ports and will show an error (HyperServer unable to bind). Example screenshot:

https://unigui.com/doc/online_help/clip0281.png

3

3. Plan to run IIS and HyperServer on the same ports but different IP addresses

If you cannot disable IIS, you can bind IIS and HyperServer to different IP addresses. Each server can listen on the same ports but on separate IPs.

In this example:

  • Existing network interface has IP 192.168.1.4.

  • We add a secondary IP 192.168.1.5 to the interface (manually via network settings).

Screenshot after adding the secondary IP:

https://unigui.com/doc/online_help/clip0282.png

4

4. Configure HyperServer to bind to the new IP only

In the HyperServer CFG file set:

[hyper_server]
bindings=192.168.1.5

This makes HyperServer listen on 192.168.1.5 only. However, IIS may still be bound to all IPs (0.0.0.0) and thus still occupy 192.168.1.5. Verify with netstat — port 80 and 443 may show as bound to 0.0.0.0 meaning all IPs:

https://unigui.com/doc/online_help/clip0283.png

5

5. Restrict IIS to specific IP addresses using netsh

Open an elevated (Administrator) command prompt and add the IP addresses you want IIS to use for its services:

netsh http add iplisten ipaddress=127.0.0.1
netsh http add iplisten ipaddress=192.168.1.4

Screenshot:

https://unigui.com/doc/online_help/clip0284.png

6

6. Restart HTTP/IIS services

Stop HTTP service (this will stop dependent services):

net stop http /y

Screenshot:

https://unigui.com/doc/online_help/clip0285.png

Start the World Wide Web Publishing Service:

net start w3svc

Screenshot:

https://unigui.com/doc/online_help/clip0286.png

7

7. Verify IIS is bound only to the selected IPs

Use netstat to verify ports 80 and 443 are bound only to 127.0.0.1 and 192.168.1.4 (not to 192.168.1.5). Example:

https://unigui.com/doc/online_help/clip0287.png

You can also show the iplisten list with:

netsh http show iplisten

Screenshot:

https://unigui.com/doc/online_help/clip0322.png

8

8. Run HyperServer; it should now bind to 192.168.1.5 on ports 80/443

After IIS is restricted to the IPs above, start the HyperServer dedicated instance. If successful, there will be no binding error. Test in a browser:

http://192.168.1.5/@info

Screenshot:

https://unigui.com/doc/online_help/clip0289.png

9

If you previously redirected a domain (socket.fmsoft.net) to 127.0.0.1, update it to point to the HyperServer IP (192.168.1.5). Edit:

C:\Windows\System32\drivers\etc\hosts

Change the mapping to:

(socket.fmsoft.net → 192.168.1.5)

Screenshot showing hosts edit:

https://unigui.com/doc/online_help/clip0288.png

Verify by pinging:

https://unigui.com/doc/online_help/clip0290.png

10

10. Test HyperServer using the domain name

With hosts updated, test using the domain:

https://unigui.com/doc/online_help/clip0291.png https://unigui.com/doc/online_help/clip0292.png

No port numbers in the URL indicate the server is bound to the default HTTP/HTTPS ports.

11

11. Reconfigure the test application to use the dedicated server

Since HyperServer now uses default ports, update the test application's configuration:

  • Set ExternalServerUrl to:

    • http://socket.fmsoft.net (You may also use http://192.168.1.5, but using a domain is preferable.)

  • Set GlobalBinding to:

    • socket.fmsoft.net

Screenshot showing test app config:

https://unigui.com/doc/online_help/clip0293.png

You can set the test application port back to the uniGUI default 8077 because that port is no longer used by the dedicated WebSockets server:

https://unigui.com/doc/online_help/clip0295.png

12

12. Verify the test application works with the dedicated server on default ports

After changes, the test application connects to the dedicated server running on default HTTP ports. Example screenshots:

https://unigui.com/doc/online_help/clip0296.png https://unigui.com/doc/online_help/clip0297.png https://unigui.com/doc/online_help/clip0298.png

circle-info

Summary: By adding a secondary IP to the server network interface, restricting IIS to specific IPs using netsh iplisten, and configuring HyperServer to bind to the secondary IP, you can run IIS and HyperServer side-by-side on the same default ports (80 and 443).