Struct actix_web::dev::ConnectionInfo [−][src]
pub struct ConnectionInfo { /* fields omitted */ }
Expand description
HttpRequest
connection information
Implementations
Create ConnectionInfo instance for a request.
Scheme of the request.
Scheme is resolved through the following headers, in this order:
- Forwarded
- X-Forwarded-Proto
- Uri
Hostname of the request.
Hostname is resolved through the following headers, in this order:
- Forwarded
- X-Forwarded-Host
- Host
- Uri
- Server hostname
remote_addr address of the request.
Get remote_addr address from socket address
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
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for ConnectionInfo
impl Send for ConnectionInfo
impl Sync for ConnectionInfo
impl Unpin for ConnectionInfo
impl UnwindSafe for ConnectionInfo
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more