[Twisted-web] Re: how to get remote add use twsited.web2
xiaolianyi at gmail.com
Tue Nov 20 22:58:41 EST 2007
I'm sorry for my without thking words saying that use
request.remoteAddr.host can't get client ip address
actually it works well.
Because AJAX's GET or POST method have domain limitation, and I deploy my
twisted.web2 program under Nginx.
so it is not a client direct request my web2 program, it's nginx request my.
web2 program is allways get 127.0.0.1.
i solve it in this way, edit nginx configure file,
add proxy_set_header REMOTE_ADDR $remote_addr;
web2 program file
use request.headers._raw_headers.get('remote_addr', ['192.168.1.1'])
Graeme Glass,Jean-Paul: thanks for your reply^_^
2007/11/21, Jean-Paul Calderone <exarkun at divmod.com>:
> It's better to explain how something didn't meet your expectations rather
> than to just say that it didn't.
> What about request.remoteAddr is not suitable?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Twisted-web