WebSocketClient Component
Properties Methods Events Configuration Settings Errors
The WebSocketClient component is used to establish a WebSocket connection to a server.
Syntax
TipeWebSocketClient
Remarks
The WebSocketClient component provides a simple way to establish a WebSocket connection to a server. The server must support the WebSocket protocol. After the connection is established data can be sent and received.
To begin, call the Connect method. After the connection is established you can send and receive data in a variety of ways. To send data you may set the DataToSend property or call Send, SendFile, or SendText. Data is received via the DataIn event.
The component supports both plain-text (ws://) and SSL (wss://) connections.
Property List
The following is the full list of the properties of the component with short descriptions. Click on the links for further details.
AcceptData | Enables or disables data reception (the DataIn event). |
Authorization | The Authorization string to be sent to the server. |
AuthScheme | The authentication scheme to use when server authorization is required. |
BytesSent | The number of bytes actually sent after an assignment to DataToSend . |
Connected | Shows whether the component is connected. |
Cookies | Collection of cookies. |
DataFormat | The format of the data being sent. |
DataToSend | A string of data to be sent to the remote host. |
Firewall | A set of properties related to firewall access. |
FollowRedirects | Determines what happens when the server issues a redirect. |
LocalHost | The name of the local host or user-assigned IP interface through which connections are initiated or accepted. |
LocalPort | The TCP port in the local host where the component binds. |
Origin | The Origin header field value. |
OtherHeaders | Other headers as determined by the user (optional). |
ParsedHeaders | Collection of headers returned from the last request. |
Password | A password if authentication is to be used. |
Proxy | A set of properties related to proxy access. |
ReadyToSend | Indicates whether the component is ready to send data. |
SSLAcceptServerCertEncoded | The certificate (PEM/base64 encoded). |
SSLCertEncoded | The certificate (PEM/base64 encoded). |
SSLCertStore | The name of the certificate store for the client certificate. |
SSLCertStorePassword | If the certificate store is of a type that requires a password, this property is used to specify that password in order to open the certificate store. |
SSLCertStoreType | The type of certificate store for this certificate. |
SSLCertSubject | The subject of the certificate used for client authentication. |
SSLServerCertEncoded | The certificate (PEM/base64 encoded). |
SubProtocols | Optional subprotocols supported by the client. |
Timeout | A timeout for the component. |
TransferredHeaders | The full set of headers as received from the server. |
User | A user name if authentication is to be used. |
Method List
The following is the full list of the methods of the component with short descriptions. Click on the links for further details.
AddCookie | Adds a cookie and the corresponding value to the outgoing request headers. |
Config | Sets or retrieves a configuration setting. |
Connect | Connects to the specified host. |
Disconnect | Disconnects from the remote host. |
DoEvents | Processes events from the internal message queue. |
Interrupt | Interrupt the current method. |
Ping | Sends a Ping request to the remote host. |
Reset | Reset the component. |
ResetHeaders | Resets all HTTP Headers, Cookies, LocalFile , and AttachedFile . |
Send | Sends data to the remote host. |
SendFile | Sends file to the remote host. |
SendText | Sends text data to the server. |
Event List
The following is the full list of the events fired by the component with short descriptions. Click on the links for further details.
Connected | Fired immediately after a connection completes (or fails). |
ConnectionStatus | Fired to indicate changes in connection state. |
DataIn | Fired when data is received. |
Disconnected | Fired when a connection is closed. |
Error | Information about errors during data delivery. |
Header | Fired every time a header line comes in. |
Log | Fires once for each log message. |
ReadyToSend | Fired when the component is ready to send data. |
Redirect | Fired when a redirection is received from the server. |
SetCookie | Fired for every cookie set by the server. |
SSLServerAuthentication | Fired after the server presents its certificate to the client. |
SSLStatus | Shows the progress of the secure connection. |
Configuration Settings
The following is a list of configuration settings for the component with short descriptions. Click on the links for further details.
BufferMessage | Indicates whether or not the entire message is buffered before firing the DataIn event. |
DataInEOM | Provides the EOM for the next available chunk of data when SinglePacketMode is True. |
DataInText | Provides the next available chunk of data when SinglePacketMode is True. |
DisconnectStatusCode | Specifies the status code when closing a connection. |
DisconnectStatusDescription | Specifies the message associated with the disconnect status code. |
MaxFrameSize | Specifies the maximum size of the outgoing message in bytes before fragmentation occurs. |
MessageLength | The length of the message (in bytes) when sending asynchronously. |
SinglePacketMode | Determines how received data is provided. |
StatusLine | The first line of the last HTTP server response. |
TransferredData | The body of the last HTTP server response. |
URL | The URL to which the component connected. |
AcceptEncoding | Used to tell the server which types of content encodings the client supports. |
AllowHTTPCompression | This property enables HTTP compression for receiving data. |
AllowHTTPFallback | Whether HTTP/2 connections are permitted to fallback to HTTP/1.1. |
Append | Whether to append data to LocalFile. |
Authorization | The Authorization string to be sent to the server. |
BytesTransferred | Contains the number of bytes transferred in the response data. |
ChunkSize | Specifies the chunk size in bytes when using chunked encoding. |
CompressHTTPRequest | Set to true to compress the body of a PUT or POST request. |
EncodeURL | If set to true the URL will be encoded by the component. |
FollowRedirects | Determines what happens when the server issues a redirect. |
GetOn302Redirect | If set to true the component will perform a GET on the new location. |
HTTP2HeadersWithoutIndexing | HTTP2 headers that should not update the dynamic header table with incremental indexing. |
HTTPVersion | The version of HTTP used by the component. |
IfModifiedSince | A date determining the maximum age of the desired document. |
KeepAlive | Determines whether the HTTP connection is closed after completion of the request. |
KerberosSPN | The Service Principal Name for the Kerberos Domain Controller. |
LogLevel | The level of detail that is logged. |
MaxRedirectAttempts | Limits the number of redirects that are followed in a request. |
NegotiatedHTTPVersion | The negotiated HTTP version. |
OtherHeaders | Other headers as determined by the user (optional). |
ProxyAuthorization | The authorization string to be sent to the proxy server. |
ProxyAuthScheme | The authorization scheme to be used for the proxy. |
ProxyPassword | A password if authentication is to be used for the proxy. |
ProxyPort | Port for the proxy server (default 80). |
ProxyServer | Name or IP address of a proxy server (optional). |
ProxyUser | A user name if authentication is to be used for the proxy. |
SentHeaders | The full set of headers as sent by the client. |
StatusLine | The first line of the last response from the server. |
TransferredData | The contents of the last response from the server. |
TransferredDataLimit | The maximum number of incoming bytes to be stored by the component. |
TransferredHeaders | The full set of headers as received from the server. |
TransferredRequest | The full request as sent by the client. |
UseChunkedEncoding | Enables or Disables HTTP chunked encoding for transfers. |
UseIDNs | Whether to encode hostnames to internationalized domain names. |
UserAgent | Information about the user agent (browser). |
CloseStreamAfterTransfer | If true, the component will close the upload or download stream after the transfer. |
ConnectionTimeout | Sets a separate timeout value for establishing a connection. |
FirewallAutoDetect | Tells the component whether or not to automatically detect and use firewall system settings, if available. |
FirewallHost | Name or IP address of firewall (optional). |
FirewallPassword | Password to be used if authentication is to be used when connecting through the firewall. |
FirewallPort | The TCP port for the FirewallHost;. |
FirewallType | Determines the type of firewall to connect through. |
FirewallUser | A user name if authentication is to be used connecting through a firewall. |
KeepAliveInterval | The retry interval, in milliseconds, to be used when a TCP keep-alive packet is sent and no response is received. |
KeepAliveTime | The inactivity time in milliseconds before a TCP keep-alive packet is sent. |
Linger | When set to True, connections are terminated gracefully. |
LingerTime | Time in seconds to have the connection linger. |
LocalHost | The name of the local host through which connections are initiated or accepted. |
LocalPort | The port in the local host where the component binds. |
MaxLineLength | The maximum amount of data to accumulate when no EOL is found. |
MaxTransferRate | The transfer rate limit in bytes per second. |
ProxyExceptionsList | A semicolon separated list of hosts and IPs to bypass when using a proxy. |
TCPKeepAlive | Determines whether or not the keep alive socket option is enabled. |
TcpNoDelay | Whether or not to delay when sending packets. |
UseIPv6 | Whether to use IPv6. |
LogSSLPackets | Controls whether SSL packets are logged when using the internal security API. |
OpenSSLCADir | The path to a directory containing CA certificates. |
OpenSSLCAFile | Name of the file containing the list of CA's trusted by your application. |
OpenSSLCipherList | A string that controls the ciphers to be used by SSL. |
OpenSSLPrngSeedData | The data to seed the pseudo random number generator (PRNG). |
ReuseSSLSession | Determines if the SSL session is reused. |
SSLCACerts | A newline separated list of CA certificate to use during SSL client authentication. |
SSLCheckCRL | Whether to check the Certificate Revocation List for the server certificate. |
SSLCipherStrength | The minimum cipher strength used for bulk encryption. |
SSLEnabledCipherSuites | The cipher suite to be used in an SSL negotiation. |
SSLEnabledProtocols | Used to enable/disable the supported security protocols. |
SSLEnableRenegotiation | Whether the renegotiation_info SSL extension is supported. |
SSLIncludeCertChain | Whether the entire certificate chain is included in the SSLServerAuthentication event. |
SSLNegotiatedCipher | Returns the negotiated ciphersuite. |
SSLNegotiatedCipherStrength | Returns the negotiated ciphersuite strength. |
SSLNegotiatedCipherSuite | Returns the negotiated ciphersuite. |
SSLNegotiatedKeyExchange | Returns the negotiated key exchange algorithm. |
SSLNegotiatedKeyExchangeStrength | Returns the negotiated key exchange algorithm strength. |
SSLNegotiatedProtocol | Returns the negotiated protocol version. |
SSLProvider | The name of the security provider to use. |
SSLSecurityFlags | Flags that control certificate verification. |
SSLServerCACerts | A newline separated list of CA certificate to use during SSL server certificate validation. |
TLS12SignatureAlgorithms | Defines the allowed TLS 1.2 signature algorithms when UseInternalSecurityAPI is True. |
TLS12SupportedGroups | The supported groups for ECC. |
TLS13KeyShareGroups | The groups for which to pregenerate key shares. |
TLS13SignatureAlgorithms | The allowed certificate signature algorithms. |
TLS13SupportedGroups | The supported groups for (EC)DHE key exchange. |
AbsoluteTimeout | Determines whether timeouts are inactivity timeouts or absolute timeouts. |
FirewallData | Used to send extra data to the firewall. |
InBufferSize | The size in bytes of the incoming queue of the socket. |
OutBufferSize | The size in bytes of the outgoing queue of the socket. |