Re: NAT Traversal
| From: | Fahad Pervaiz | Date: | Thu, 05 Jul 2007 11:38:35 +0000 |
| Subject: | Re: NAT Traversal | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-258310@lists.php.net to get a copy of this message | ||
What i am trying to do is that,
i have an ecommerce shopping cart application developed and deployed on many
servers. Now i want to put support for the clients having cookies disabled.
There are two options to do it.
1. Pass session id in the url ($_GET) array (encrypted or unencrypted)
2. Store session ID against IP in the database
Option 1 requires large amount of work and changes required even on all the
sytem that have the ecommerce application, so that makes it less feasable
Option 2 seems much doable as updates required in the deployed systems is
less.
Theoratically it should work as follows:
If client is using a proxy then store session id against actual IP + proxy
addr
If client is using NAT then store session against the NAT addr + the
internal IP
If client is not behind nat and not using proxy then store against the
public IP
Thats why i was looking for a way to get the internal ip, somehow
I don't need to access the client directly but the reason to get his
internal IP is to store session id against client's nat addr+internal ip
Hope you get my point
On 7/5/07, Stut <stuttle@gmail.com> wrote:
Please include the list when replying. Fahad Pervaiz wrote: Thanks for the reply!!! I need to get the internal IP of the client. Is it possible to get it via javascript?? I have tried to search some scripts but found nothing useful. No, you can't. Javascript runs in a sandbox that limits what it can do. You could do this by utilising other client-side technology such as ActiveX controls or possibly Java. Both would require the user to give them permission to access that information. However, think about what you are trying to do. Say my local IP is 192.168.0.5. I got through a gateway (NAT server) at 192.168.0.1 which proxies my connections out to the internet with the public IP 80.1.1.1. Your server, on the internet, cannot access my local machine (192.168.0.5) from outside my network unless the gateway (NAT server) forwards ports through to it, which is highly unlikely. So even if you could get my local IP it would not be of any use to you. Why don't you tell us what you are actually trying to do - there may be a better way to do it. -Stut -- http://stut.net/ On 7/5/07, *Stut* <stuttle@gmail.com <mailto:stuttle@gmail.com>> wrote:-- Regards Fahad Pervaiz www.ecommerce-xperts.com (Shopping Cart Applications, Framework for Multilingual Web Sites, Web Designs)Fahad Pervaiz wrote:Hello, I want to get the actual IP of a client behind NAT or a Firewall.Is thereanyway to traverse NAT to get the actuall/real IP of the clientto checkweather its reachable directly or not. OR Is there anyother way to do that. Plz suggestNo, you can't. And even if you could it wouldn't do you any good.Thinkabout what NAT does and you'll realise why.As for firewalls... if there was a way around it there'd be no pointinhaving the firewall.-Stut-- http://stut.net/ <http://stut.net/>-- Regards Fahad Pervaiz www.ecommerce-xperts.com <http://www.ecommerce-xperts.com> (Shopping Cart Applications, Framework for Multilingual Web Sites, Web Designs)