惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Forbes - Security
Forbes - Security
GbyAI
GbyAI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
S
SegmentFault 最新的问题
Y
Y Combinator Blog
Recorded Future
Recorded Future
博客园 - Franky
I
InfoQ
T
The Blog of Author Tim Ferriss
Recent Announcements
Recent Announcements
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
阮一峰的网络日志
阮一峰的网络日志
T
Tailwind CSS Blog
Cyberwarzone
Cyberwarzone
The Register - Security
The Register - Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
雷峰网
雷峰网
P
Palo Alto Networks Blog
G
GRAHAM CLULEY
Cloudbric
Cloudbric
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
MongoDB | Blog
MongoDB | Blog
F
Full Disclosure
Google DeepMind News
Google DeepMind News
Recent Commits to openclaw:main
Recent Commits to openclaw:main
C
Check Point Blog
爱范儿
爱范儿
The GitHub Blog
The GitHub Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
W
WeLiveSecurity
T
Threat Research - Cisco Blogs
U
Unit 42
N
Netflix TechBlog - Medium
The Cloudflare Blog
Spread Privacy
Spread Privacy
Microsoft Azure Blog
Microsoft Azure Blog
美团技术团队
T
Troy Hunt's Blog
Engineering at Meta
Engineering at Meta
H
Heimdal Security Blog
TaoSecurity Blog
TaoSecurity Blog
C
Cybersecurity and Infrastructure Security Agency CISA
T
Tenable Blog
B
Blog
S
Securelist
H
Hacker News: Front Page
Google Online Security Blog
Google Online Security Blog
G
Google Developers Blog

博客园 - 好窝

SQL Server 日期和时间函数 面试谈离职 技巧很重要 服务器应用程序不可用 Scripting.FileSystemObject 的文件复制,删除,移动操作 - 好窝 - 博客园 刷新框架网页七种方法 asp套打位置 三层结构 RecordSet中的open完全的语法 域名删除时间及whois状态说明 把书看薄,再看厚 ContentType类型 使用Request.Servervariables("HTTP_USER_AGENT")取值 HTTP 头已经写入到客户浏览器。任何HTTP 头的修改必须在写入页内容之前。 使用获取url中的文件名和传过来的值 Response.ContentType Response.AddHeader使用实例收集 怎么重启IIS 笔记本键盘设置 安装SQL2000时提示错误:以前的某个程序安装己在安装计算机上创建挂起的文件操作
HTTP_X_FORWARDED_FOR & REMOTE_ADDR
好窝 · 2008-03-11 · via 博客园 - 好窝

   在 ASP 中使用 Request.ServerVariables("REMOTE_ADDR") 来取得客户端的 IP 地址,但如果客户端是使用代理服务器来访问,那取到的就是代理服务器的 IP 地址,而不是真正的客户端 IP 地址。要想透过代理服务器取得客户端的真实 IP 地址,就要使用 Request.ServerVariables("HTTP_X_FORWARDED_FOR") 来读取。不过要注意的事,并不是每个代理服务器都能用 Request.ServerVariables("HTTP_X_FORWARDED_FOR") 来读取客户端的真实 IP,有些用此方法读取到的仍然是代理服务器的 IP。还有一点需要注意的是:如果客户端没有通过代理服务器来访问,那么用Request.ServerVariables ("HTTP_X_FORWARDED_FOR") 取到的值将是空的。因此,如果要在程序中使用此方法,可以这样处理:

1if Request.ServerVariables("HTTP_X_FORWARDED_FOR")<>"" then
2remoteaddr=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
3else
4remoteaddr=Request.ServerVariables("REMOTE_ADDR")
5end if