473,588 Members | 2,574 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 7591
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
11810
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: ------------------------------------------------- function FindProxyForURL(url,host) { me=myIpAddress();
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 WebProxy.Credentials property so I can get through the proxy server.
5
5356
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
4233
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 to internet through our Proxy server. Now any other computer which is also on LAN and is...
3
3789
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 service through a HTTP proxy? Please post any relevant code you have, THANKS!
5
3448
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 code. Is there any way around this?
2
3042
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 firewall in between. Question is would my application have any problems if it is calling the
6
2868
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
18503
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 functions to include page content from my local server, and other servers local to my machine. When I try...
0
1559
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 for this problem? Thanks in advance.
0
7927
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8220
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8352
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7981
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6632
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5723
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3846
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1457
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1194
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.