Re: Obtaining the remote ip address

2006-03-28 Thread EP
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']

  

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Obtaining the remote ip address

2006-03-28 Thread Peter Hansen
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

-- 
http://mail.python.org/mailman/listinfo/python-list


Obtaining the remote ip address

2006-03-27 Thread Alvin A. Delagon
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?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Obtaining the remote ip address

2006-03-27 Thread Justin Ezequiel
os.environ['REMOTE_ADDR']
os.environ['REMOTE_HOST']

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Obtaining the remote ip address

2006-03-27 Thread Ben Finney
Alvin A. Delagon [EMAIL PROTECTED] writes:

 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?

The CGI specification lists a number of environment variables that are
set for the scrit receiving the request. The one you want is
REMOTE_ADDR, and possibly REMOTE_HOST.

URL:http://hoohoo.ncsa.uiuc.edu/cgi/env.html

Python makes environment variables available via the 'os.environ' map.

URL:http://docs.python.org/lib/os-procinfo.html

-- 
 \ I cannot conceive that anybody will require multiplications at |
  `\the rate of 40,000 or even 4,000 per hour ...  -- F. H. Wales |
_o__)   (1936) |
Ben Finney

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Obtaining the remote ip address

2006-03-27 Thread Alvin A. Delagon
Thanks a lot Justin! ^_^

-- 
http://mail.python.org/mailman/listinfo/python-list