[][src]Struct actix_web::dev::ConnectionInfo

pub struct ConnectionInfo { /* fields omitted */ }

HttpRequest connection information

Implementations

impl ConnectionInfo[src]

pub fn get<'a>(req: &'a RequestHead, cfg: &AppConfig) -> Ref<'a, Self>[src]

Create ConnectionInfo instance for a request.

pub fn scheme(&self) -> &str[src]

Scheme of the request.

Scheme is resolved through the following headers, in this order:

  • Forwarded
  • X-Forwarded-Proto
  • Uri

pub fn host(&self) -> &str[src]

Hostname of the request.

Hostname is resolved through the following headers, in this order:

  • Forwarded
  • X-Forwarded-Host
  • Host
  • Uri
  • Server hostname

pub fn remote_addr(&self) -> Option<&str>[src]

remote_addr address of the request.

Get remote_addr address from socket address

pub fn realip_remote_addr(&self) -> Option<&str>[src]

Real ip remote addr of client initiated HTTP request.

The addr is resolved through the following headers, in this order:

  • Forwarded
  • X-Forwarded-For
  • remote_addr name of opened socket

Security

Do not use this function for security purposes, unless you can ensure the Forwarded and X-Forwarded-For headers cannot be spoofed by the client. If you want the client's socket address explicitly, use HttpRequest::peer_addr() instead.

Trait Implementations

impl Clone for ConnectionInfo[src]

impl Debug for ConnectionInfo[src]

impl Default for ConnectionInfo[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,