Struct ws::Request [] [src]

pub struct Request { /* fields omitted */ }

The handshake request.

Methods

impl Request
[src]

[src]

Get the value of the first instance of an HTTP header.

[src]

Edit the value of the first instance of an HTTP header.

[src]

Access the request headers.

[src]

Edit the request headers.

[src]

Get the origin of the request if it comes from a browser.

[src]

Get the unhashed WebSocket key sent in the request.

[src]

Get the hashed WebSocket key from this request.

[src]

Get the WebSocket protocol version from the request (should be 13).

[src]

Get the path of the request.

[src]

Get the possible protocols for the WebSocket connection.

[src]

Add a possible protocol to this request. This may result in duplicate protocols listed.

[src]

Remove a possible protocol from this request.

[src]

Get the possible extensions for the WebSocket connection.

[src]

Add a possible extension to this request. This may result in duplicate extensions listed. Also, the order of extensions indicates preference, so if the preference matters, consider using the Sec-WebSocket-Protocol header directly.

[src]

Remove a possible extension from this request. This will remove all configurations of the extension.

[src]

Get the IP address of the client.

This method will attempt to retrieve the most likely IP address of the requester in the following manner:

If the X-Forwarded-For header exists, this method will return the left most address in the list.

If the Forwarded HTTP Header Field exits, this method will return the left most address indicated by the for parameter, if it exists.

Note

This method does not ensure that the address is a valid IP address.

[src]

Attempt to parse an HTTP request from a buffer. If the buffer does not contain a complete request, this will return Ok(None).

[src]

Construct a new WebSocket handshake HTTP request from a url.

[src]

Write a request out to a buffer

Trait Implementations

impl Debug for Request
[src]

[src]

Formats the value using the given formatter. Read more

impl Display for Request
[src]

[src]

Formats the value using the given formatter. Read more