Obtaining the remote ip address

Discussion in 'Python' started by Justin Ezequiel, Mar 28, 2006.

  1. os.environ['REMOTE_ADDR']
    os.environ['REMOTE_HOST']
    Justin Ezequiel, Mar 28, 2006
    #1
    1. Advertising

  2. One quick question:

    I have a python cgi script running behind a CGI server which is also
    built using python using CGIHTTPServer module. How can my cgi script
    obtain the remote ip address?
    Alvin A. Delagon, Mar 28, 2006
    #2
    1. Advertising

  3. Justin Ezequiel

    EP Guest

    While on the subject of network identity, does anyone have a scheme to
    get the MAC address of the end device? I've never come up with a way to
    do it, but I haven't had it proven to me that it is impossible (yet).


    Justin Ezequiel wrote:

    >os.environ['REMOTE_ADDR']
    >os.environ['REMOTE_HOST']
    >
    >
    >
    EP, Mar 28, 2006
    #3
  4. Justin Ezequiel

    Peter Hansen Guest

    EP wrote:
    > While on the subject of network identity, does anyone have a scheme to
    > get the MAC address of the end device? I've never come up with a way to
    > do it, but I haven't had it proven to me that it is impossible (yet).


    Which end? I'll assume you mean _not_ the server end. :)

    The MAC address for the client end (i.e. the end you don't control)
    isn't going to be available to you unless it's local to your network.
    If that's the case, one option is parsing the output of the "arp"
    command as appropriate for your platform (note: this is inherently a
    platform-specific issue).

    If the other end is not local, it's unclear what value the MAC address
    would have for you. Maybe describing that will lead to some more
    effective solutions being suggested.

    -Peter
    Peter Hansen, Mar 28, 2006
    #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. avnrao
    Replies:
    1
    Views:
    7,222
    avnrao
    May 4, 2004
  2. Ben Finney

    Re: Obtaining the remote ip address

    Ben Finney, Mar 28, 2006, in forum: Python
    Replies:
    0
    Views:
    474
    Ben Finney
    Mar 28, 2006
  3. Replies:
    0
    Views:
    321
  4. Dido Sevilla
    Replies:
    1
    Views:
    223
    Anders Engström
    Feb 23, 2005
  5. Victor Rosillo
    Replies:
    2
    Views:
    166
    Bill Kelly
    Nov 24, 2007
Loading...

Share This Page