Secure web socket client
OperationsCode example:
client := SecureWebSocket->New(Url->New("wss://echo.websocket.org"));
if(client->Connect()) {
client->ReadSocketText()->PrintLine();
client->WriteTextSocket("Hello World!");
client->ReadSocketText()->PrintLine();
client->CloseSocket();
};
Constructor
New(url:Web.HTTP.Url, cookies_enabled:Bool)
Name | Type | Description |
---|---|---|
url | Url | URL |
cookies_enabled | Bool | true if cookies are enabled, false otherwise |
Constructor
New(url:Web.HTTP.Url)
Name | Type | Description |
---|---|---|
url | Url | URL |
Adds a HTTPS request header
method : public : AddHeader(name:String, value:String) ~ Nil
Name | Type | Description |
---|---|---|
name | String | header name |
value | String | header value |
Closes the web socket connection
method : public : CloseSocket() ~ Nil
Closes the web socket connection
method : public : CloseSocket(reason:Int) ~ Nil
Name | Type | Description |
---|---|---|
reason | Int | reason to close socket |
Opens a connection to a web socket
method : public : Connect() ~ Bool
Type | Description |
---|---|
Bool | true if connected, false otherwise |
Sets cookie support
method : public : EnableCookies(cookies_enabled:Bool) ~ Nil
Name | Type | Description |
---|---|---|
cookies_enabled | Bool | true if cookies are enabled, false otherwise |
Gets the cookies
method : public : GetCookies() ~ Vector<Cookie>
Type | Description |
---|---|
Vector<Cookie> | vector of cookies |
Gets the socket's X.509 certificate issuer name
method : public : GetIssuer() ~ String
Type | Description |
---|---|
String | certificate issuer name |
Gets the last status code
method : public : GetStatusCode() ~ Int
Type | Description |
---|---|
Int | last status code |
Gets the last status message
method : public : GetStatusMessage() ~ String
Type | Description |
---|---|
String | last status message |
Gets the socket's X.509 certificate subject name
method : public : GetSubject() ~ String
Type | Description |
---|---|
String | certificate subject name |
Pings the websocket server
method : public : PingSocket() ~ Bool
Type | Description |
---|---|
Bool | true if pinged, false otherwise |
Reads binary input from the web socket
method : public : ReadSocketBinary() ~ Byte[]
Type | Description |
---|---|
Byte[] | binary input read, Nil otherwise |
Reads text from the web socket
method : public : ReadSocketText() ~ String
Type | Description |
---|---|
String | text read, Nil otherwise |
Removes a HTTPS request header
method : public : RemoveHeader(name:String) ~ Nil
Name | Type | Description |
---|---|---|
name | String | header name |
Writes binary output to the web socket
method : public : WriteSocket(data:Byte[], fragment:Bool) ~ Bool
Name | Type | Description |
---|---|---|
data | Byte[] | binary payload |
fragment | Bool | true if fragmented, false otherwise |
Type | Description |
---|---|
Bool | true if successful, false otherwise |
Writes text to the web socket
method : public : WriteSocket(message:String, fragment:Bool) ~ Bool
Name | Type | Description |
---|---|---|
message | String | message |
fragment | Bool | true if fragmented, false otherwise |
Type | Description |
---|---|
Bool | true if successful, false otherwise |