WebSocket Client Command Line Application for Windows, OSX and Linux

WebSocket Client Commands

Fully Featured Application

Supports Full RFC6455 and widely tested by thousands of users.

TLS Supports

Supports secure websocket connections without external libraries (OSX and Linux requires openssl 1.0.2)

Easy to Use

Simple but very powerful.

Watchdog and HeartBeat

Automatic recovery after a disconnection and heartbeat support.

WebSocket Client Win32

sgcWebSocketClient Win32
WebSocket Client Win32

WebSocket Client Win64

sgcWebSocketClient Win64
WebSocket Client Win64

WebSocket Client OSX64

sgcWebSocketClient OSX64
WebSocket Client OSX64

WebSocket Client OSXARM64

sgcWebSocketClient OSXARM64
WebSocket Client OSXARM64

WebSocket Client Linux64

sgcWebSocketClient Linux64
WebSocket Client Linux64

How Open a new WebSocket Connection

Example: open a websocket connection to echo.websocket.org

{"message": "open", "params":{"url": "ws://www.esegece.com:2052"}}

Example: open a secure websocket connection to echo.websocket.org

{"message": "open", "params":{"url": "wss://www.esegece.com:2053"}}

How Send a Text message

Example: send a message to server "This is my First Message"

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

Example: broadcast a message to all connected clients

{"message": "broadcast", "params":{"text": "This message is for all"}}

 

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}}

Close Connection

Example: close connection

{"message": "close"}

Example: restart connection

{"message": "close"}

{"message": "open"}

 

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