WebSocket

class WebSocket(val uri: String) : Endpoint(source)

The remote side of a WebSocket (RFC 8323 §4). Like Tcp, messages are scoped to the connection.

For a connection this side opens, uri is the ws or wss URI of the WebSocket endpoint (see of); for an accepted one, the scheme and the address of the WebSocket client. uri is kept as given.

Equality compares uri as RFC 7252 §6.6 compares URIs (RFC 3986 §6.2.2 and §6.2.3), with the default ports of RFC 6455 §3, which RFC 8323 §8.3 and §8.4 use: the scheme and the host case-insensitively, IP literals in their RFC 5952 form, a missing port as 80 for ws and 443 for wss, an empty path as /, percent-encoded unreserved characters as the characters and other percent-encodings with upper-case hex digits; the path and the query are otherwise compared exactly. ws and wss are distinct even on the same host and port (RFC 8323 §8.4), so endpoints that differ only in usesTls are different peers. Text that is not a ws or wss URI with a host compares exactly.

Constructors

Link copied to clipboard
constructor(uri: String)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

coap+ws or coaps+ws.

Link copied to clipboard
val uri: String
Link copied to clipboard

Whether the WebSocket runs over TLS (wss, RFC 8323 §8.4).

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String