Struct ratchet_rs::WebSocketUpgrader [−][src]
pub struct WebSocketUpgrader<S, E> { /* fields omitted */ }
Expand description
Represents a client connection that has been accepted and the upgrade request validated. This may be used to validate the request by a user and opt to either continue the upgrade or reject the connection - such as if the target path does not exist.
Implementations
The subprotocol that the client has requested.
Attempt to upgrade this to a fully negotiated WebSocket connection.
Errors
Errors if there is an IO error.
pub async fn upgrade_with(
self,
headers: HeaderMap<HeaderValue>
) -> Result<UpgradedServer<S, E>, Error>
pub async fn upgrade_with(
self,
headers: HeaderMap<HeaderValue>
) -> Result<UpgradedServer<S, E>, Error>
Insert headers
into the response and attempt to upgrade this to a fully negotiated
WebSocket connection.
Errors
Errors if there is an IO error.