HttpContext Type

The `HttpContext` is the container of the request, runtime, user-state and response.

Record fields

Record Field Description

connection

Full Usage: connection

Field type: Connection

The connection for the request being processed

Field type: Connection

request

Full Usage: request

Field type: HttpRequest
Modifiers: mutable

The HTTP request being processed

Field type: HttpRequest

response

Full Usage: response

Field type: HttpResult

The response for the request being processed

Field type: HttpResult

runtime

Full Usage: runtime

Field type: HttpRuntime

The `HttpRuntime` for the request being processed

Field type: HttpRuntime

userState

Full Usage: userState

Field type: Dictionary<string, obj>

The user state for the request being processed

Field type: Dictionary<string, obj>

Instance members

Instance member Description

this.clientIp trustProxy sources

Full Usage: this.clientIp trustProxy sources

Parameters:
    trustProxy : bool
    sources : string list

Returns: IPAddress

Get the IP of the client from the `HttpContext`.

trustProxy : bool
sources : string list
Returns: IPAddress

this.clientIpTrustProxy

Full Usage: this.clientIpTrustProxy

Returns: IPAddress
 Warning; if you don't write these headers in your rev.proxy, the client will
 be able to spoof them. Related headers:
 - client-ip
 - x-forwarded-for: the "X-Forwarded-For" client request header field with
   the $remote_addr variable appended to it, separated by a comma. If the
   "X-Forwarded-For" field is not present in the client request header, the
   $proxy_add_x_forwarded_for variable is equal to the $remote_addr variable.
   from http://nginx.org/en/docs/http/ngx_http_proxy_module.html

 Related blog entry, with suggestion on nginx module to use to recursively
 tell all upstream proxies to overwrite X-Real-IP:
 http://distinctplace.com/infrastructure/2014/04/23/story-behind-x-forwarded-for-and-x-real-ip-headers/
Returns: IPAddress

this.clientPort trustProxy sources

Full Usage: this.clientPort trustProxy sources

Parameters:
    trustProxy : bool
    sources : string list

Returns: Port
trustProxy : bool
sources : string list
Returns: Port

this.clientPortTrustProxy

Full Usage: this.clientPortTrustProxy

Returns: Port
Returns: Port

this.clientProto trustProxy sources

Full Usage: this.clientProto trustProxy sources

Parameters:
    trustProxy : bool
    sources : string list

Returns: string
trustProxy : bool
sources : string list
Returns: string

this.clientProtoTrustProxy

Full Usage: this.clientProtoTrustProxy

Returns: string
Returns: string

this.isLocal

Full Usage: this.isLocal

Returns: bool
Returns: bool

this.isLocalTrustProxy

Full Usage: this.isLocalTrustProxy

Returns: bool
Returns: bool