How to get clientside IP-addr

Discussion in 'Javascript' started by David Cook, Aug 7, 2004.

  1. David Cook

    David Cook Guest

    Is it possible in Javascript to determine the numerical
    IP-addr that the client is using?

    (Normally, I'd do this on the server-side, where it is trivial.)

    But, I'm just curious how to do it on the client-side if it's
    possible. Of course, in general, the client IP-addr wouldn't
    even be relevant if the current page/document came from
    a 'file://' URL, but I'm assuming if the current document
    came from a (non-local) http:// URL, then maybe both
    the server and the CLIENT ip-address could be acquired
    somehow.

    Can it be done?
    David Cook, Aug 7, 2004
    #1
    1. Advertising

  2. David Cook

    Hywel Guest

    In article <>, says...
    > Is it possible in Javascript to determine the numerical
    > IP-addr that the client is using?
    >
    > (Normally, I'd do this on the server-side, where it is trivial.)
    >
    > But, I'm just curious how to do it on the client-side if it's
    > possible. Of course, in general, the client IP-addr wouldn't
    > even be relevant if the current page/document came from
    > a 'file://' URL, but I'm assuming if the current document
    > came from a (non-local) http:// URL, then maybe both
    > the server and the CLIENT ip-address could be acquired
    > somehow.
    >
    > Can it be done?


    Wouldn't you already know the server's IP address? After all, that's
    where the page is coming from. As for the client IP, it's relatively
    useless when you consider that move users connect through some sort of
    proxy (transparent or otherwise) that means the thousands of users have
    the same IP address.

    http://developer.irt.org/script/1685.htm


    --
    Hywel

    http://sponsorhywel.org.uk/
    Hywel, Aug 7, 2004
    #2
    1. Advertising

  3. On Sat, 7 Aug 2004 13:15:48 -0400, David Cook <(who wants to know?)> wrote:

    > Is it possible in Javascript to determine the numerical
    > IP-addr that the client is using?


    [snip]

    I don't believe so; I can't think of any way off the top of my head. Check
    the group archives with Google. I'm sure this has been covered before.

    Mike

    --
    Michael Winter
    Replace ".invalid" with ".uk" to reply by e-mail
    Michael Winter, Aug 7, 2004
    #3
  4. David Cook

    Grant Wagner Guest

    David Cook wrote:

    > Is it possible in Javascript to determine the numerical
    > IP-addr that the client is using?
    >
    > (Normally, I'd do this on the server-side, where it is trivial.)
    >
    > But, I'm just curious how to do it on the client-side if it's
    > possible. Of course, in general, the client IP-addr wouldn't
    > even be relevant if the current page/document came from
    > a 'file://' URL, but I'm assuming if the current document
    > came from a (non-local) http:// URL, then maybe both
    > the server and the CLIENT ip-address could be acquired
    > somehow.
    >
    > Can it be done?


    In addition to what others have said, you should understand what
    "client" IP-addr you are referring to.

    1) are you referring to the private (typically) non-routable IP
    address the computer on my LAN has (192.168.0.x)? This can be
    obtained in some versions of Netscape, but since it is a private
    (typically) non-routable IP address that is also assigned to
    possibly thousands of other computers around the world, it's not
    very useful.
    2) are you referring to the IP address assigned to my gateway by my
    ISP? This can not be obtained using any mechanism I know of if I'm
    using a proxy.
    3) are you referring to the IP address of the proxy which I use to
    browse the Web? This can be easily obtained by the server.

    --
    Grant Wagner <>
    comp.lang.javascript FAQ - http://jibbering.com/faq
    Grant Wagner, Aug 9, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. steve
    Replies:
    3
    Views:
    1,420
    Mike Treseler
    Sep 4, 2003
  2. fpgawizz

    not able to write to addr loc x0

    fpgawizz, Apr 2, 2005, in forum: VHDL
    Replies:
    1
    Views:
    426
    info_
    Apr 2, 2005
  3. Replies:
    2
    Views:
    673
    gene tani
    Dec 14, 2005
  4. =?utf-8?B?5LiA6aaW6K+X?=

    My python can not get addr info

    =?utf-8?B?5LiA6aaW6K+X?=, Apr 16, 2006, in forum: Python
    Replies:
    1
    Views:
    920
    Serge Orlov
    Apr 16, 2006
  5. Nikos Kanellopoulos

    get host by addr

    Nikos Kanellopoulos, Aug 11, 2007, in forum: Ruby
    Replies:
    1
    Views:
    103
    Nikos Kanellopoulos
    Aug 11, 2007
Loading...

Share This Page