In that case you want the router's ip, not the server's private ip 
behind the router, and this is exactly what $_SERVER['REMOTE_ADDR'] 
yields. You'll also have to set up some portfowarding on the target 
router to give you access to whatever port/protocol you want to use for 
your remote access.

Aus wrote:
> The deal is not that i want to get an anonymous users IP,
> instead, i have several servers that i want to keep them accessable
> all the time.
> some of them are behind NAT, or proxy.
>
> if only one server have static publich IP, i can use it to collect
> real-time information about the other server and how to access them.
>
> for instance, server A who is behind NAT will send message to the
> public server saying "it's me A, i'm here!"
> the public server should update the database with "A is there"
>
> for servers who have dynamic public address, it's been solved, but for
> the ones behind NATs and proxies, i don't know.
>
> Aus
>
> On Jan 6, 10:50 pm, Webweave <[email protected]> wrote:
>   
>> Well, since I'm not sure what you want the IP address for, I'm not
>> sure I can answer your question, but ...
>>
>> In order to get the client IP address, you have to ask the client for
>> it (javescript, executable, etc).
>>
>> That said, the address may be completely useless to you.
>>
>> Take an example of a NAT network I know of. All of the devices inside
>> the subnet have unroutable IP adresses like you get for DHCP
>> (192.168.*). The NAT translation takes care of connecting these
>> devices to the internet, and return a "real" address for the domain,
>> so your server sees the same address for the whole domain.
>>
>> Then say you have somebody sitting at Starbuck's. Amazingly enough,
>> almost every Wi-fi hotspot in the world uses the same sort of scheme,
>> so you get an address from a similar unroutable pool.
>>
>> So you have two different sets of devices that cam be using the same
>> IP address at the same time.
>>
>> On Jan 6, 1:39 pm, Aus <[email protected]> wrote:
>>
>>
>>
>>     
>>> Webweaves,
>>> thanks for your answer,
>>>       
>>> is there any ´solution to access back servers behind NATs and proxies?
>>>       
>>> Aus
>>>       
>>> On Jan 6, 9:56 pm, Webweave <[email protected]> wrote:
>>>       
>>>> Note that this can be misleading for people using proxy servers, since
>>>> you'll get the IP address of the proxy instead of the actual machine
>>>> in most cases. Same is true for NAT based IP addresses, you will
>>>> typically get a single IP address for a NAT subnet.
>>>>         
>>>> On Jan 6, 11:53 am, Aus <[email protected]> wrote:
>>>>         
>>>>> Fantastic!! works just fine
>>>>>           
>>>>> Cheers mate!
>>>>>           
>>>>> Aus
>>>>>           
>>>>> On Jan 6, 9:10 am, Graham Weldon <[email protected]> wrote:
>>>>>           
>>>>>> $_SERVER['REMOTE_ADDR'] should tell you what you need.
>>>>>>             
>>>>>> Cheers,
>>>>>> Graham
>>>>>>             
>>>>>> Aus wrote:
>>>>>>             
>>>>>>> I'm writing an application like no-ip.com , the user will send a _POST
>>>>>>> message includes the domain name to the website, and the website
>>>>>>> should map the domain name in the message with the source IP of the
>>>>>>> message. and update it in the database.
>>>>>>>               
>>>>>>> so when someone have a computer at home with dynamic IP and he want to
>>>>>>> access it remotely, he can always know his new IP from this website.
>>>>>>>               
>>>>>>> is it possible for a Webpage installed on a webhost server to
>>>>>>> determine the source IP of a packet?
>>>>>>>               
>>>>>>> any advise from where should i start? where should i search about the
>>>>>>> subject?
>>>>>>>               
>>>>>>> thanks alot !
>>>>>>>               
>>>>>>> * i know how to do it if it's on my computer, i'll just make some C
>>>>>>> script to capture the packets and tell. but first, that's an over
>>>>>>> kill, second, it doesn't work in this case, i'm use a webhost server,
>>>>>>> not my own.- Hide quoted text -
>>>>>>>               
>>>>>> - Show quoted text -- Hide quoted text -
>>>>>>             
>>>> - Show quoted text -- Hide quoted text -
>>>>         
>> - Show quoted text -
>>     
> >
>
>   


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to