由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
BuildingWeb版 - 高手帮忙:如何得到remote user IP address?
相关主题
apache web server under NT4.0?请问, 自己做还是请人做?
请教一个cgi的newbie问题Re: 谁能帮我一个大忙,先万分感谢!
讨论一下怎么处理以登陆的用户 (转载)[转载] 问个router port forwarding 的问题
perl + sas - the backtick operator - use specific userapache英文怎么读?
建个基本的网站那里比较好新手起步
where can i find good 计数器 host?How to get parameters from the IE addres
留言簿为何不能发表文字?【求指点】导师问我怎么在网页中加个password
有谁有用的顺手的留言簿?请问怎么查网站访问者的ip地址?
相关话题的讨论汇总
话题: ip话题: 用户话题: perl话题: proxy话题: env
进入BuildingWeb版参与讨论
1 (共1页)
h***i
发帖数: 11
1
我想在网页中实现下面的功能:
web server:阿帕奇
language: cgi/perl 5.0
想在用户点击我的网页时,记录用户的ip地址。
现在我用 $env{remote_addr} (at lease something like this)
但是得到的是用户的proxy的地址。(如果用户使用了代理的话)
如何得到真实的ip地址?
例子:www.5460.net的留言簿,就可以检测用户的真实抵制。
谢谢了。
M******t
发帖数: 309
2
http://www.pscode.com/vb/scripts/ShowCode.asp?txtCodeId=884&lngWId=8
看看这个,不过是php的code,应该差不太多

【在 h***i 的大作中提到】
: 我想在网页中实现下面的功能:
: web server:阿帕奇
: language: cgi/perl 5.0
: 想在用户点击我的网页时,记录用户的ip地址。
: 现在我用 $env{remote_addr} (at lease something like this)
: 但是得到的是用户的proxy的地址。(如果用户使用了代理的话)
: 如何得到真实的ip地址?
: 例子:www.5460.net的留言簿,就可以检测用户的真实抵制。
: 谢谢了。

s**********i
发帖数: 711
3
as I answered to hobli already, there are many proxy
servers don't forward the "real" IP... it's pretty
much useless to do much about IP.

【在 M******t 的大作中提到】
: http://www.pscode.com/vb/scripts/ShowCode.asp?txtCodeId=884&lngWId=8
: 看看这个,不过是php的code,应该差不太多

p******f
发帖数: 162
4

as shi's said, not all proxy forwards real client ip address, but
if the proxy does include the real client ip in the http request,
apache/perl will not hide it, so that means in theory, you can do
(with apache/perl) whatever 5460 can do, no more, no less.
actually doing it is not difficault, check the http request sent
by proxy, (using a sniffer like tcpdump or nfrep) see whating in
the request header.
print out all the env of your perl script, you may find the real ip
in some env variable, or

【在 h***i 的大作中提到】
: 我想在网页中实现下面的功能:
: web server:阿帕奇
: language: cgi/perl 5.0
: 想在用户点击我的网页时,记录用户的ip地址。
: 现在我用 $env{remote_addr} (at lease something like this)
: 但是得到的是用户的proxy的地址。(如果用户使用了代理的话)
: 如何得到真实的ip地址?
: 例子:www.5460.net的留言簿,就可以检测用户的真实抵制。
: 谢谢了。

h***i
发帖数: 11
5

thx a lot! I really learn something valuable! :)

【在 p******f 的大作中提到】
:
: as shi's said, not all proxy forwards real client ip address, but
: if the proxy does include the real client ip in the http request,
: apache/perl will not hide it, so that means in theory, you can do
: (with apache/perl) whatever 5460 can do, no more, no less.
: actually doing it is not difficault, check the http request sent
: by proxy, (using a sniffer like tcpdump or nfrep) see whating in
: the request header.
: print out all the env of your perl script, you may find the real ip
: in some env variable, or

h***i
发帖数: 11
6

thx a lot, it really helps!!

【在 M******t 的大作中提到】
: http://www.pscode.com/vb/scripts/ShowCode.asp?txtCodeId=884&lngWId=8
: 看看这个,不过是php的code,应该差不太多

1 (共1页)
进入BuildingWeb版参与讨论
相关主题
请问怎么查网站访问者的ip地址?建个基本的网站那里比较好
如何存储用户提交的表格where can i find good 计数器 host?
[转载] Perl for programmers(10): A template for CGI file留言簿为何不能发表文字?
[转载] Perl for programmers(9): subroutines有谁有用的顺手的留言簿?
apache web server under NT4.0?请问, 自己做还是请人做?
请教一个cgi的newbie问题Re: 谁能帮我一个大忙,先万分感谢!
讨论一下怎么处理以登陆的用户 (转载)[转载] 问个router port forwarding 的问题
perl + sas - the backtick operator - use specific userapache英文怎么读?
相关话题的讨论汇总
话题: ip话题: 用户话题: perl话题: proxy话题: env