TsgcWebSocketClient

Client WebSocket component — connects to any RFC 6455 WebSocket server and sends/receives text and binary messages.

Introduction

TsgcWebSocketClient implements Client WebSocket Component and can connect to a WebSocket Server. Follow the steps below to configure this component:

1. Create a TsgcWebSocketClient instance in code (new TsgcWebSocketClient()).

2. Set Host and Port (default is 80) to connect to an available WebSocket Server. You can set URL property and Host, Port, Parameters... will be updated from URL. Example: wss://127.0.0.1:8080/ws/ will result in:


oClient = new TsgcWebSocketClient();
oClient.Host = "127.0.0.1";
oClient.Port = 80;
oClient.TLS = true;
oClient.Options.Parameters = "/ws/";

3. You can select if you require TLS (secure connection) or not, by default, it is not activated.

4. You can connect through an HTTP Proxy Server, you need to define proxy properties:

Host: proxy server hostname.

Port: proxy server port number.

Username: username for authentication, leave blank for anonymous.

Password: password for authentication, leave blank for anonymous.

5. If the server supports compression, you can enable compression to compress messages that are sent.

6. Set Specifications allowed, by default, all specifications are enabled.

RFC6455: is standard and recommended WebSocket specification.

Hixie76: always is false

7. Set Active = true (or call Connect()) to start a new WebSocket connection.

Reference

Guides

Most common uses