[Twisted-web] Re: how to get remote add use twsited.web2

xiao lianyi xiaolianyi at gmail.com
Tue Nov 20 10:54:22 EST 2007


use request.remoteAddr.host can't get client ip address!!!

and i try to use request.headers, but it has not client ip address in it
too.

blow is my twisted log:
2007-11-20 23:47:56+0800 [HTTPChannel,0,127.0.0.1]
<Headers: Raw: {'accept-language': ['zh-CN,zh,en-US;q=3D0.9,en;q=3D0.9,UTF-=
8;q=3D
0.8,UTF;q=3D0.8,zh-cn;q=3D0.7,zh-tw;q=3D0.7,zh-hans;q=3D0.6,utf-8;q=3D0.6,u=
tf;q=3D0.5
,en-us;q=3D0.5,de-DE;q=3D0.4,de;q=3D0.4,en-uk;q=3D0.3,en-AU;q=3D0.3,it-IT;q=
=3D0.2,it;q=3D
0.2,cs-CZ;q=3D0.1,cs;q=3D0.1,en;q=3D0.0'], 'accept-encoding': ['gzip,deflat=
e'],
'accept': ['text/xml,application/xml,application/xhtml+xml,text/html;q=3D0.9
,text/plain;q=3D0.8,image/png,*/*;q=3D0.5'], 'user-agent': ['Mozilla/5.0 (X=
11;
U; FreeBSD i386; zh-CN; rv:1.8.1.9) Gecko/20071112 Firefox/2.0.0.9'],
'accept-charset': ['x-gbk,utf-8;q=3D0.7,*;q=3D0.7'], 'host': ['localhost:80=
89'],
'x-requested-with': ['XMLHttpRequest'], 'referer': ['
http://localhost/index.html?mid=3D101&pid=3D1']} Parsed: {'accept-language':
<RecalcNeeded>, 'accept-encoding': <RecalcNeeded>, 'accept': <RecalcNeeded>,
'user-agent': <RecalcNeeded>, 'accept-charset': <RecalcNeeded>, 'host':
'localhost:8089', 'x-requested-with': <RecalcNeeded>, 'referer':
<RecalcNeeded>}>


2007/11/20, Graeme Glass <graemeglass at gmail.com>:
>
>
> I believe this is what you are looking for:
> (twisted.web2.http.Request)
>
> http://twistedmatrix.com/projects/web2/documentation/howto/resource-apis.=
xhtml
>  <http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-web/attachments/20071120/7e=
505fe9/attachment.htm


More information about the Twisted-web mailing list