Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 MOD: Handle HTTP_X_FORWARDED_FOR
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

(.)z
New Member

United Kingdom
85 Posts

Posted - 03 January 2001 :  08:31:21  Show Profile  Visit (.)z's Homepage  Send (.)z an AOL message  Send (.)z an ICQ Message  Send (.)z a Yahoo! Message
I noticed that my IP address as being reported by Snitz was not what WinIPCfg said my IP address was. When I examined the server variables page, I found the HTTP_X_FORWARDED_FOR HTTP header which contained my real IP. The following code changes cause Snitz to report the users real IP

In inc_functions.asp add the following function (line 1877 in sr4)
'## Return the remote users real IP address
function remoteIP()
remoteIP = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
if remoteIP = "" then
remoteIP = Request.ServerVariables("REMOTE_ADDR")
end if
end function


Then in post_info.asp replace both calls to
Request.ServerVariables("REMOTE_ADDR")
with
remoteIP()
and anywhere else that REMOTE_ADDR is referenced (in my case, the Active Users mod needs changing also).

If there are other headers with hold this kind of information then it is a simple case of extending remoteIP() to deal with it.

Regards - z

tilttek
Junior Member

Canada
333 Posts

Posted - 03 January 2001 :  13:59:28  Show Profile  Visit tilttek's Homepage
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
I noticed that my IP address as being reported by Snitz was not what WinIPCfg said my IP address was. When I examined the server variables page, I found the HTTP_X_FORWARDED_FOR HTTP header which contained my real IP. The following code changes cause Snitz to report the users real IP
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Hum, this is very strange... Are you behing a firewall ou are you using any kind of proxy? Or maybe is our ISP who is using a proxy.

Philippe Gamache
http://www.tilttek.com
http://www.lapageamelkor.com
Go to Top of Page

(.)z
New Member

United Kingdom
85 Posts

Posted - 06 January 2001 :  20:16:03  Show Profile  Visit (.)z's Homepage  Send (.)z an AOL message  Send (.)z an ICQ Message  Send (.)z a Yahoo! Message
Sorry, It's the snitz forum code not the web site. The site where the problem was encountered is my site.

The site is not (apparently) behind a firewall, although after much investigations, my ISP has stuck a web cache in the way (outside of my control) and it is this that is doing the forwarding.

The point is, it may be accessed through a firewall and this code detects it and gets the right IP.

Regards - <img src=icon_smile_cool.gif border=0 align=middle>z - http://www.discuss-online.co.uk/

Edited by - (.)z on 06 January 2001 20:17:17
Go to Top of Page

bugfix
Starting Member

Singapore
47 Posts

Posted - 10 January 2001 :  20:51:23  Show Profile
yeap, it's also true on my case.

HTTP_X_FORWARDED_FOR HTTP header is my REAL IP, if i'm behind a proxy or firewall.

Go to Top of Page

(.)z
New Member

United Kingdom
85 Posts

Posted - 11 January 2001 :  18:05:51  Show Profile  Visit (.)z's Homepage  Send (.)z an AOL message  Send (.)z an ICQ Message  Send (.)z a Yahoo! Message
Come on Snitz Developers, comment on this one. Is it a sensible mod?

Can't see how it would do any harm and it will fix this incorret IP problem.

Regards - z - http://www.discuss-online.co.uk/
Go to Top of Page

(.)z
New Member

United Kingdom
85 Posts

Posted - 11 January 2001 :  18:08:43  Show Profile  Visit (.)z's Homepage  Send (.)z an AOL message  Send (.)z an ICQ Message  Send (.)z a Yahoo! Message
BTW, my header is coming from a transparent cache (does not appear on a tracert, nor do you configure it in your browser) from Network Applience. They have an FAQ which may be of use to people Caching Tutorial for Web Authors and Webmasters

Regards - z - http://www.discuss-online.co.uk/

Edited by - (.)z on 31 January 2001 09:09:59
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.12 seconds. Powered By: Snitz Forums 2000 Version 3.4.07