WebSocket Client Open Connection

Configure WebSocket client to connect to a websocket server is very easy, find below some examples which show how configure client, there are basically 2 methods:

 

Decode Server Parameters

ws://echo.websocket.org

Client.Host := 'echo.websocket.org;

Client.Port := 80;

Client.TLS := False;

 

wss://echo.websocket.org

Client.Host := 'echo.websocket.org';

Client.Port := 443;

Client.TLS := True;

 

wss://ws.binaryws.com/websockets/v3?app_id=1089

Client.Host := 'ws.binaryws.com';

Client.Port := 443;

Client.Options.Parameters := '/websockets/v3?app_id=1089';

 

Set URL Property (decodes server parameters automatically)

ws://echo.websocket.org

 

Client.URL := 'ws://echo.websocket.org';

 

wss://echo.websocket.org

Client.URL := 'wss://echo.websocket.org';

 

 

wss://ws.binaryws.com/websockets/v3?app_id=1089

Client.URL := 'wss://ws.binaryws.com/websockets/v3?app_Id=1089/';

 

Once websocket client is configured, just call Client.Active := True to connect to websocket server.