class Lucky::RemoteIpHandler


Sets the HTTP::Request#remote_address value as Socket::IPAddress? to the value of the last IP in the X-Forwarded-For header, or fallback to the default remote_address.

This will also set a remote_ip String value as String which will be either the raw remote_address value, or an empty string.

This Handler does a "best guess" for the IP which is generally good enough. If you require IP based Authentication, then you may want to handle this on your own as there will be edge cases when related to mobile clients on the go, and potential IP spoofing attacks. More detailed info:

Included Modules

Defined in:


Constant Summary

HABITAT_SETTINGS = [{decl: ip_header_name : String = "X-Forwarded-For", example: nil, validation: nil}] of Nil

Class Method Summary

Instance Method Summary

Instance methods inherited from class Object

blank? : Bool blank?, present? : Bool present?

Class Method Detail

def self.configure(&) #

[View source]
def self.settings #

[View source]

Instance Method Detail

def call(context) #

[View source]
def settings #

[View source]