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:
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).