LICENSE NEWS README
UnXF

Methods

::new #on_broken_addr #on_untrusted_addr #unxf!

class UnXF

Rack middleware to remove "HTTP_X_FORWARDED_FOR" in the Rack environment and replace "REMOTE_ADDR" with the value of the original client address.

Constants

LOCALHOST

IPv4 localhost addresses (127.0.0.0/8)

LOCALHOST6

IPv6 localhost address (::1/128)

RFC_1918

local LAN addresses described in RFC 1918

Public Class Methods

new (app, trusted = [:RFC_1918, :LOCALHOST, :LOCALHOST6]) source

In your Rack config.ru:

use UnXF

If you do not want to trust any hosts other than "0.6.6.6", you may only specify one host to trust:

use UnXF, "0.6.6.6"

If you want to trust "0.6.6.6" in addition to the default set of hosts:

use UnXF, [ :RFC_1918, :LOCALHOST, "0.6.6.6" ]

Public Instance Methods

on_broken_addr (env, xff_str) source

Our default action on a broken address is to just fall back to calling the app without modifying the env

on_untrusted_addr (env, xff_str) source

Our default action on an untrusted address is to just fall back to calling the app without modifying the env

unxf! (env) source

returns nil on success and a Rack response triplet on failure This allows existing applications to use UnXF without putting it into the middleware stack (to avoid increasing stack depth and GC time)


Pages Classes Methods
mail archives: http://bogomips.org/unxf-public/
	nntp://news.public-inbox.org/inbox.comp.lang.ruby.unxf 
public: unxf-public@bogomips.org
source code: git clone http://bogomips.org/unxf.git
	git clone git://bogomips.org/unxf.git