WebSocket Server Command Line Application for Windows, OSX and Linux

WebSocket Server Commands

Fully Featured Application

Supports Full RFC6455 and widely tested by thousands of users.

Multiple Threads support

Supports thousands of concurrent users.

Easy to Use

Simple but very powerful.

Watchdog and HeartBeat

Automatic recovery after a disconnection and heartbeat support.

WebSocket Server Win32

sgcWebSocketServer Win32
WebSocket Server Win32

WebSocket Server Win64

sgcWebSocketServer Win64
WebSocket Server Win64

WebSocket Server OSX64

sgcWebSocketServer OSX64
WebSocket Server OSX64

WebSocket Server OSXARM64

sgcWebSocketServer OSXARM64
WebSocket Server OSXARM64

WebSocket Server Linux64

sgcWebSocketServer Linux64
WebSocket Server Linux64

Start server

Example: start server listening 127.0.0.1:5400

{"message": "start", "params":{"host": "127.0.0.1", "port":5400}}

Example: start server listening 93.84.14.55:80

{"message": "start", "params":{"host": "93.84.14.55", "port":80}}

How send a message

Example: broadcast "This is my First Message" to all connected clients

{"message": "broadcast", "params":{"text": "This is my First Message"}}

Example: send "This is my First Message" to client with guid "HSDDU8333"

{"message": "write", "params":{"guid":"HSDDU8333", "text": "This is my First Message"}}

How Enable HeartBeat and WatchDog

Example: Enable heartbeat every 30 seconds.

{"message": "options", "params":{"heartbeat": {"enabled": true, "interval": 30}}

Example: Enable watchdog every 10 seconds.

{"message": "options", "params":{"watchdog": {"enabled": true, "interval": 10}}

Example: Disable heartbeat

{"message": "options", "params":{"heartbeat": {"enabled": false}}

Example: Disable watchdog 

{"message": "options", "params":{"watchdog": {"enabled": false}}

Stop server

{"message": "stop"}

 

TCP Server

All console applications can run an internal TCP Server that allows to send and receive commands as if were written directly on the console application.

Just start the application with the command -server and a new server will be started listening on port 8080. Example: if you want enable the server on WebSocket client, start the console application as follows:

sgcWebSocketClient.exe -server

Find below the full TCP Server parameters:

-server: starts the internal server on port 8080

-server.port: sets the listening port

-server.ip: sets the binding ip (useful if there are multiple ips).

If the server is enabled, a client connected to this server can send any JSON message and will receive any response as if was written directly from console application.

Example: if you want enable server on IP 192.168.1.1 and Port 5412

sgcWebSocketClient.exe -server -server.ip 192.168.1.1 -server.port 5412