Configuring the Application

Next step is to configure a new web application which will use a second dedicated WebSockets server running on port 88.

This new web application will run on HyperServer and will deploy an application named chat. Create a new HyperServer instance in a new sub-folder named demo2 and choose DLL as the deployment mode.

Below are the required settings to force HyperServer to use the new dedicated WebSockets server.

1

HyperServer WebSockets settings

Populate your HyperServer config with the following INI section:

[websockets]
enabled=1
aux_port=0
max_queue_length=1000
binding=
global_binding=socket.fmsoft.net
global_port=88
external_server_url=https://socket.fmsoft.net:88
external_server_token=ma.......55417381
app_domain=demo

Note: This time we populate global_port because we are using a non-default port.

2

Adding the Chat Application

Add an application entry for the chat app:

[application-0]
enabled=1
alias=chat
binary_name=wsbasicchat.exe
max_nodes=0
persistent_node=0

We configure the HyperServer instance to publish an application named chat (demonstrated previously). No WebSockets-specific adjustments are required for the application itself because the HyperServer instance settings serve as defaults for all applications in the instance. This simplifies deploying WebSockets-enabled applications in a HyperServer cluster.

3

Testing the Application

The application is deployed to the main server and can be accessed globally at:

https://prime.fmsoft.net/demo2/mdemo.dll/chat

clip0358
clip0359

Examining the page source reveals the chat application is using the WebSockets server at wss://socket.fmsoft.net:88 as intended.

This demonstrates a dedicated WebSockets server listening on the same IP as the web server but on a different port.

circle-exclamation