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

    pub struct ConnectionInfo { /* fields omitted */ }

`HttpRequest` connection information

## Methods

###

`impl ConnectionInfo`

[src]

####

`pub fn update(&mut self, req: &Request)`

[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(&self) -> Option<&str>`

[src]

Remote IP of client initiated HTTP request.

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

- Forwarded
- X-Forwarded-For
- peer name of opened socket

## Trait Implementations

###

`impl Clone for ConnectionInfo`

[src]

####

`fn clone(&self) -> ConnectionInfo`

[src]

Returns a copy of the value. Read more

####

`fn clone_from(&mut self, source: &Self)`

1.0.0
[src]

Performs copy-assignment from `source`. Read more

###

`impl Default for ConnectionInfo`

[src]

####

`fn default() -> ConnectionInfo`

[src]

Returns the "default value" for a type. Read more

## Auto Trait Implementations

###

`impl Send for ConnectionInfo`

###

`impl Sync for ConnectionInfo`

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g. `str,u8` or `String,struct:Vec,test`)