473,554 Members | 2,829 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IPA behind proxy

Is there a way to retrieve IP address behind a proxy?

Mhaxx

Jul 16 '05 #1
13 7583
Mhaxx <mh***@despamme d.com> writes:
Is there a way to retrieve IP address behind a proxy?


Sometimes.

$_SERVER['X_FORWARDED_FO R'] works on some of them, not on others.

--
Chris
Jul 16 '05 #2
On Fri, 05 Sep 2003 10:10:25 +0200, Mhaxx <mh***@despamme d.com> wrote:
Is there a way to retrieve IP address behind a proxy?


this is what I use (doesn't always work:

if ($_SERVER['HTTP_X_FORWARD ED_FOR']) {
$ipaddress = $_SERVER['HTTP_X_FORWARD ED_FOR']." (through proxy
".$_SERVER['REMOTE_ADDR'].")";
}
else {
$ipaddress = $_SERVER['REMOTE_ADDR'];
}
?>

Jul 16 '05 #3
>this is what I use (doesn't always work:

There isn't $_SERVER['HTTP_X_FORWARD ED_FOR'] in my proxy headers! :-((

Are there other ways?

Mhaxx

Jul 16 '05 #4

Are there other ways?


Try this, which I picked up from someone else:
# Function to obtain the IP address behind cache
function getRealIp () {

# Obtain the server addresses
#!# These potentially require an isSet
$HCIP = $_SERVER['HTTP_CLIENT_IP '];
$HXF = $_SERVER['HTTP_X_FORWARD ED'];
$HXFF = $_SERVER['HTTP_X_FORWARD ED_FOR'];
$RMAD = $_SERVER['REMOTE_ADDR'];

# Logic to ascertain which to use
$ipAddress = ($HCIP != '') ? $HCIP :
($HXF != '') ? $HXF :
($HXFF != '') ? $HXFF :
($RMAD != '') ? $RMAD : '';

# Return the result
return $ipAddress;
}

Martin

Jul 16 '05 #5
>Try this, which I picked up from someone else:

Nothing, I always get the IP address of my proxy!

I think that if my proxy doesn't add IPA visitors header into its
headers, I can't obtain IPA visitors.. is it right?

Mhaxx

Jul 16 '05 #6
Mhaxx <mh***@despamme d.com> writes:
Try this, which I picked up from someone else:


I think that if my proxy doesn't add IPA visitors header into its
headers, I can't obtain IPA visitors.. is it right?


Make a PHP page solely containing <?php phpinfo(); ?> View it through
the proxy. Do a search on the page for your real IP. If you can't
find it, the proxy doesn't send it, and no, you can't obtain it. If
you can find it, you should have a big hint as to what the variable
it's in is called.

--
Chris
Jul 16 '05 #7
>the proxy. Do a search on the page for your real IP. If you can't
find it, the proxy doesn't send it, and no, you can't obtain it.


I can't see the "real" IPA in phpinfo().

I have no other ways, right? :-°°(

Mhaxx

Jul 16 '05 #8
Mhaxx <mh***@despamme d.com> writes:
the proxy. Do a search on the page for your real IP. If you can't
find it, the proxy doesn't send it, and no, you can't obtain it.


I can't see the "real" IPA in phpinfo().

I have no other ways, right? :-°°(


Well, you could ask the user to type their IP into a box on the page.
It might be possible to use Javascript to grab it client-side and put
it into a hidden field, but that's going to be unreliable at best, and
might _really_ annoy some people (if someone's going out of their way
to keep their IP hidden, trying to find it is going to make them
leave, fast).

Looks like you'll just have to give up on this one.

What do you need the IP for, anyway?

--
Chris
Jul 16 '05 #9
>Well, you could ask the user to type their IP into a box on the page.

No no..
What do you need the IP for, anyway?


To trace accesses to my web site, and (maybe) to trace visitors IPA
when they buy something in my merchant site.. I know what you think:
it's not a good idea, because you can change your IPA if you want, so
it's not a secure way..

Mhaxx

Jul 16 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
11807
by: demonhunter | last post by:
Hi, I am trying to fetch a web content using LWP and HTTP modules behind corp firewall. I set proxy server as shown in my internet explorer connection setup. When i run the script, i got successful response, but the return content is not the webpage i requested at all. It shows something like:...
5
980
by: Bill Hauver | last post by:
I am attempting to use a web service from my work pc which is behind a firewall. I have used wsdl.exe to create the web service reference class and added it to my project. (this seems to work without a hitch). Before I use this class, I make the necessary calls to instantiate a WebProxy class and then pass in my credentials to set the...
5
5355
by: John | last post by:
Hi Does anyone have an example of using the Internet Transfer Control from behind a proxy server on port 8080? Thanks Regards
2
4229
by: Yassar | last post by:
I want my P2P application to works well even when users are behind proxy or LAN. i.e Two instance of my application should be able to communicate even if they are on different LANs but indirrectly connected to internet. To elaborate it further, suppose there is a computer on my office LAN running my application. This computer is connected...
3
3783
by: Thomas Miller | last post by:
Is there ANY way for a windows app to consume a web service by going through a SOCKS proxy? This is a MUST for me because the windows app I am building will be deployed to many corporate clients who are behind SOCKS proxies. My app also has corporate clients that are behind a HTTP proxy. Is there a way for the windows app to consume a web...
5
3446
by: james.dixon | last post by:
Hi I have been struggling with what should be a simple thing. I want to crawl the web for specific links, and save any html and files that meet my criteria to my hard drive. I thought that WebRequest/WebResponse would be the best way to go, using a proxy. The page that I am returned is just a proxy generated file, and not the source...
2
3041
by: sameer | last post by:
hi all, Description of my .net application: Desktop application using webservices over the internet to communicate with the sql server2000 database which is sitting behind the webserver. Done in VS2003 using VB.net on framework 1.1, Database is sql server 2000 Application works perfectectly ok and no problems at all even if there is a...
6
2863
by: sameer | last post by:
..NET Framework 1.1 VS2003 Application is making webservice calls from behind a proxy server and then freezes and dies. Questoin is can i use webservice over proxy server( i guess another name of them is ISA ... if i a not wrong), if yes how? Sameer
2
18500
by: demotis | last post by:
I'm working on an internal website and have full control of the web server and php scripts. I do not, however, have the ability to change or modify internet access to allow me to get past the proxy server. The web server is in the local network (behind the proxy), running Windows 2003 with Apache web server, and PHP 5. I can use the include...
0
1552
by: aladdinm1 | last post by:
Dear all, I have a client application which working just fine except in one case: when it's behind a proxy. I tested it behind MS ISA with enabled Socks service. I tried everything to make it connect from behind the proxy but, it failed. I'm using .Net Framework 2.0 and it looks like it does not support Socks proxies. Is there any solution...
0
7578
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7497
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8010
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6119
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5414
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5136
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3539
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1994
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1111
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.