-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathproxy-addr.node.txt
More file actions
26 lines (21 loc) · 1.57 KB
/
proxy-addr.node.txt
File metadata and controls
26 lines (21 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
┏━━━━━━━━━━━━━━━━┓
┃ PROXY-ADDR ┃
┗━━━━━━━━━━━━━━━━┛
VERSION ==> #2.0.7
PROXY-ADDR.all #Returns all trusted 'ADDR' + first untrusted, in proxy chain
(REQ, FUNC('ADDR', NUM)->BOOL) #Proxy chain is X-Forwarded-For [C] + REQ remoteAddress (using FORWARDED, see its doc)
->'ADDR'_ARR #Trusted:
# - means reverse proxies under our control (i.e. HTTP header cannot be forged)
# - BOOL: true if trusted
# - NUM: number of proxies between origin + 1
#ARR is from closest to least close to server
PROXY-ADDR(...)->'ADDR' #Same as all().at(-1), i.e. furthest to origin only (first untrusted)
PROXY-ADDR.compile('ADDR2'[_ARR]) #Transforms 'ADDR2'[_ARR] into FUNC, where 'ADDR2' can be:
->FUNC('ADDR', NUM)->BOOL # - IPv4|v6
# - CIDR
# - netmask
# - 'loopback' (like '127.0.0.1/8', '::1/128')
# - 'linklocal' (like '169.254.0.1/16', 'fe80::/10')
# - 'uniquelocal' (like '192.168.0.1/16', '10.0.0.0/8' or '172.16.0.0/12', 'fc00::/7')
PROXY-ADDR[.all]
(..., 'ADDR2'[_ARR]) #Same but using 'ADDR2', with last logic as compile()