amelinium.http.middleware.remote-ip

added in 1.0.0

amelinium service, remote IP middleware.

get-ips-from-req-data

(get-ips-from-req-data pheader addr-string)(get-ips-from-req-data pheader addr-string proxy-setting)(get-ips-from-req-data pheader addr-string proxy-setting proxy-for-fn)

get-ips-from-req-data-lru

get-proxy-header

(get-proxy-header headers proxy-setting)

handler

(handler req)(handler req proxy-setting)(handler req proxy-setting proxy-for-fn)

ip-separator

new-reserved

(new-reserved p)

process-proxy

(process-proxy p)

Prepares proxy header configuration for address-getting middleware.

process-proxy-for

(process-proxy-for t)

Prepares configuration of proxy-detection. If the config contains a sequence it will turn it into two Trie trees of IP ranges and return a function which returns truthy value if a client IP from the given request is within any range.

proxy-header

remote-addr-get

(remote-addr-get req)

Parses :remote-addr key of a request to get the string representation of client’s IP address.

remote-addr-parse

(remote-addr-parse addr)

Parses remote address string to get the string representation of client’s IP address.

safe-ip-to-address

(safe-ip-to-address s)

wrap-ip

(wrap-ip k ip-getter-sym proxy-setting proxy-for)

Client IP getter middleware.