mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-01-31 03:27:39 +00:00
Update GetRemoteAddr documentation to clarify that it may return nil
. (#1149)
This commit is contained in:
parent
bc6c18368f
commit
01267ea0f5
1 changed files with 9 additions and 4 deletions
|
@ -1160,12 +1160,17 @@ FUNCTIONS
|
||||||
>: shared_key1 == shared_key2
|
>: shared_key1 == shared_key2
|
||||||
true
|
true
|
||||||
|
|
||||||
GetRemoteAddr() → ip:uint32,port:uint16
|
GetRemoteAddr()
|
||||||
|
├─→ ip:uint32,port:uint16
|
||||||
|
└─→ nil
|
||||||
Returns client ip4 address and port, e.g. 0x01020304,31337 would
|
Returns client ip4 address and port, e.g. 0x01020304,31337 would
|
||||||
represent 1.2.3.4:31337. This is the same as GetClientAddr except
|
represent 1.2.3.4:31337. This is the same as GetClientAddr except
|
||||||
it will use the ip:port from the X-Forwarded-For header, only if
|
it will use the ip:port from the X-Forwarded-For header when the
|
||||||
IsPrivateIp or IsLoopbackIp return true. When multiple addresses
|
IP returned by GetClientAddr is a trusted IP (returns true when
|
||||||
are present in the header, the last/right-most address is used.
|
checked against IsTrustedIp). When multiple addresses are present
|
||||||
|
in the header, the last/right-most address is used.
|
||||||
|
Returns `nil` if the address doesn't parse as IPv4 value (e.g.
|
||||||
|
because it is misformatted or an IPv6 address).
|
||||||
|
|
||||||
GetResponseBody()
|
GetResponseBody()
|
||||||
├─→ body:str
|
├─→ body:str
|
||||||
|
|
Loading…
Reference in a new issue