xff_extract: Take vectors of IPs and X-Forwarded-For headers and produce...

View source: R/RcppExports.R

xff_extractR Documentation

Take vectors of IPs and X-Forwarded-For headers and produce single, normalised IP addresses.

Description

xff_extract takes IP addresses and x_forwarded_for values and, in the event that x_forwarded_for is non-null, attempts to extract the "real" IP closest to the client.

Usage

xff_extract(ip_addresses, x_forwarded_for)

Arguments

ip_addresses

a vector of IP addresses

x_forwarded_for

an equally-sized vector of X-Forwarded-For header contents.

Value

a vector of IP addresses, incorporating the XFF header value where appropriate.

Examples

xff_extract("192.168.0.1", "193.168.0.1, 230.98.107.1")


hrbrmstr/iptools documentation built on Jan. 10, 2023, 2:54 a.m.