Crate websocket [−] [src]
Rust-WebSocket is a WebSocket (RFC6455) library written in Rust.
WebSocket clients make use of the
Client object, which features two connection
connect_ssl_context(). See the
documentation for more information. These both return a client-side
object which is sent to the server with the
send() method. The
be altered, typically using
Request.headers.set() to add additional headers
or change existing ones before calling
send() on a
Request will obtain a
Response, which can be checked
validate() method, which will return
Ok(()) if the response is a
valid one. Data frames and messages can then be sent by obtaining a
WebSocket servers act similarly to the
TcpListener, and listen for connections.
Server struct documentation for more information. The
bind_secure() functions will bind the server to the given
Server implements Iterator and can be used to iterate over incoming
Requests can be validated using
validate(), and other parts of the request may
be examined (e.g. the Host header and/or the Origin header). A call to
fail() will generate a
Response which either accepts the connection, or
denies it respectively.
Response can then be altered if necessary, and is sent with the 'send()
method, returning aClient` ready to send and receive data frames or messages.
ws module contains the traits and functions used by Rust-WebSockt at a lower
level. Their usage is explained in the module documentation.
Contains the WebSocket client.
Module containing the default implementation of data frames.
Structs representing headers relevant in a WebSocket context.
Module containing the default implementation for messages.
The default implementation of a WebSocket Receiver.
The result type used within Rust-WebSocket
The default implementation of a WebSocket Sender.
Provides an implementation of a WebSocket server
Provides the default stream type for WebSocket connections.
A module containing the traits and structs that lower layer of Rust-WebSocket is based on.