Mercurial > hg > nginx-quic
diff src/http/ngx_http_core_module.h @ 4623:ed3d0cc6de5a
New function ngx_http_get_forwarded_addr() to look up real client address.
On input it takes an original address, string in the X-Forwarded-For format
and its length, list of trusted proxies, and a flag indicating to perform
the recursive search. On output it returns NGX_OK and the "deepest" valid
address in a chain, or NGX_DECLINED. It supports AF_INET and AF_INET6.
Additionally, original address and/or proxy may be specified as AF_UNIX.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Mon, 14 May 2012 12:27:41 +0000 |
parents | b4379a91f9b5 |
children | 4a18bf1833a9 |
line wrap: on
line diff
--- a/src/http/ngx_http_core_module.h +++ b/src/http/ngx_http_core_module.h @@ -513,6 +513,9 @@ ngx_int_t ngx_http_write_filter(ngx_http ngx_int_t ngx_http_set_disable_symlinks(ngx_http_request_t *r, ngx_http_core_loc_conf_t *clcf, ngx_str_t *path, ngx_open_file_info_t *of); +ngx_int_t ngx_http_get_forwarded_addr(ngx_http_request_t *r, ngx_addr_t *addr, + u_char *xff, size_t xfflen, ngx_array_t *proxies, int recursive); + extern ngx_module_t ngx_http_core_module;