Re: IP address of webserver

2007-01-27 Thread Paul Rubin
Johny [EMAIL PROTECTED] writes: So I know that www.google.com has 209.85.129.147 IP address. But how can I find it directly from Python script? import socket print socket.gethostbyname('www.google.com') 66.102.7.147 -- http://mail.python.org/mailman/listinfo/python-list

Re: IP address of webserver

2007-01-27 Thread Gabriel Genellina
Johny [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] How can I find server's IP address? From console I can use ping, for example: C:\RobotP\cgi-binping www.google.com Pinging www.google.com [209.85.129.147] with 32 bytes of data: [...] But how can I find it directly from

Re: Getting externally-facing IP address?

2006-11-10 Thread Tim Williams
the networked IP address of the machine the code is running on? For example, my laptop's IP address is 192.168.0.101, and I want to bind a server to that address. Is there a clean way of doing so that will work, for example, when I move the code to my server (which obviously doesn't have the same IP address

Re: Getting externally-facing IP address?

2006-11-10 Thread Tim Williams
wondering is this: Is there a clean way to get the networked IP address of the machine the code is running on? For example, my laptop's IP address is 192.168.0.101, and I want to bind a server to that address. Is there a clean way of doing so that will work, for example, when I move the code to my

Re: Getting externally-facing IP address?

2006-11-10 Thread Laszlo Nagy
Michael B. Trausch wrote: Hello, Every programming example that I have seen thus far shows simple server code and how to bind to a socket--however, every example binds to the localhost address. What I am wondering is this: Is there a clean way to get the networked IP address

Re: Is there a way to find IP address?

2006-09-17 Thread Damjan
Normaly I can log user's IP address using os.environ[REMOTE_ADDR] . If a user is behind a proxy, I will log proxy's IP address only. Is there a way how to find a real IP user's address? os.environ[HTTP_X_FORWARDED_FOR] (but that can easily be spoofed, and is mostly meaningless

Re: Is there a way to find IP address?

2006-09-17 Thread Damjan
Normaly I can log user's IP address using os.environ[REMOTE_ADDR] . If a user is behind a proxy, I will log proxy's IP address only. Is there a way how to find a real IP user's address? os.environ[HTTP_X_FORWARDED_FOR] (but that can easily be spoofed, and is mostly meaningless

Re: Is there a way to find IP address?

2006-09-16 Thread Tim Roberts
Lad [EMAIL PROTECTED] wrote: Fredrik Lundh wrote: Lad wrote: Normaly I can log user's IP address using os.environ[REMOTE_ADDR] . If a user is behind a proxy, I will log proxy's IP address only. Is there a way how to find a real IP user's address? os.environ[HTTP_X_FORWARDED_FOR

Re: Is there a way to find IP address?

2006-09-15 Thread Winfried Tilanus
On 09/15/2006 Lad wrote: How can be HTTP_X_FORWARDED_FOR easily spoofed? I thought that IP address is not possible change. Because it is a header that is added by the proxy. This header has (or should have) no role in the proces of relaying the request by the proxy. It is just politely added

Is there a way to find IP address?

2006-09-13 Thread Lad
Normaly I can log user's IP address using os.environ[REMOTE_ADDR] . If a user is behind a proxy, I will log proxy's IP address only. Is there a way how to find a real IP user's address? Thank you for help. LL. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to find IP address?

2006-09-13 Thread Fredrik Lundh
Lad wrote: Normaly I can log user's IP address using os.environ[REMOTE_ADDR] . If a user is behind a proxy, I will log proxy's IP address only. Is there a way how to find a real IP user's address? os.environ[HTTP_X_FORWARDED_FOR] (but that can easily be spoofed, and is mostly meaningless

IP address

2006-08-10 Thread Lad
I would like to record visitor's IP address.How can I do that in Python? Thanks for help L -- http://mail.python.org/mailman/listinfo/python-list

Re: IP address

2006-08-10 Thread Lad
Sybren Stuvel wrote: Lad enlightened us with: I would like to record visitor's IP address.How can I do that in Python? Too little information. Visitors of what? Sybren I have a website written in Python and I would like to login every visitor's IP address. In other words, if a visitor

Re: IP address

2006-08-10 Thread Jon Ribbens
In article [EMAIL PROTECTED], Lad wrote: I have a website written in Python and I would like to login every visitor's IP address. In other words, if a visitor come to my Python application, this application will record his IP. Depending on what CGI framework you're using, something like

Re: IP address

2006-08-10 Thread Lad
Sybren Stuvel wrote: Lad enlightened us with: I have a website written in Python and I would like to login every visitor's IP address. Ehm... that's probably log not login. In other words, if a visitor come to my Python application, this application will record his IP. Is it possible

SimpleXMLRPCServer and client IP address

2006-06-28 Thread Jeremy Monnet
Hello, I've started python a few weeks ago, and to now everything went fine with my cookbook and a learning book. Now, I've tried the SimpleXMLRPCServer, and it worked OK untill I tried to get the client IP address. I have searched a long time the Internet but couldn't find a _simple_ solution

Re: SimpleXMLRPCServer and client IP address

2006-06-28 Thread Fredrik Lundh
Jeremy Monnet wrote: Tips I've found were : - use the requestHandler and its method address_string(), but I didn't an easy to understand example - http://mail.python.org/pipermail/python-list/2006-May/340266.html but this thread seems not to have been finished :-( maybe the explanation in

Re: SimpleXMLRPCServer and client IP address

2006-06-28 Thread Jeremy Monnet
Thanks for your answer ! On 6/28/06, Fredrik Lundh [EMAIL PROTECTED] wrote: maybe the explanation in that message was good enough for the poster ? I think so ... unfortunately not for me ... yet ! :-) Your handler object should be getting set up with the client_address property.

Re: How to get client's IP address in the threaded case of SimpleXMLRPCServer?

2006-05-07 Thread Chris Lambacher
of mixin classes mixing things up. I'm not confused, it's not passed. I can't figure out how to get the client IP address at all from inside my program. I can reach the socket object via my server object, but the connection has been dropped before my handler is called. Any help or pointers

How to get client's IP address in the threaded case of SimpleXMLRPCServer?

2006-05-05 Thread Eirikur Hallgrimsson
can't figure out how to get the client IP address at all from inside my program. I can reach the socket object via my server object, but the connection has been dropped before my handler is called. Any help or pointers would be appreciated. At this point I think I would need to make changes

Re: finding IP address of computer

2006-04-30 Thread Paul Watson
DarkBlue wrote: Chris wrote: How do I find and print to screen the IP address of the computer my python program is working on? def readip(): import re, urllib f = urllib.urlopen('http://checkip.dyndns.org') s = f.read() m = re.search('([\d]*\.[\d]*\.[\d]*\.[\d]*)', s) return

Re: finding IP address of computer

2006-04-28 Thread DarkBlue
Chris wrote: How do I find and print to screen the IP address of the computer my python program is working on? def readip(): import re, urllib f = urllib.urlopen('http://checkip.dyndns.org') s = f.read() m = re.search('([\d]*\.[\d]*\.[\d]*\.[\d]*)', s) return m.group(0) myip = readip

finding IP address of computer

2006-04-27 Thread Chris
How do I find and print to screen the IP address of the computer my python program is working on? -- http://mail.python.org/mailman/listinfo/python-list

Re: finding IP address of computer

2006-04-27 Thread Gregor Horvath
Chris schrieb: How do I find and print to screen the IP address of the computer my python program is working on? IP adresses are bound to network interfaces not to computers. One Computer can have multiple network interfaces. -- Servus, Gregor http://www.gregor-horvath.com -- http

Re: finding IP address of computer

2006-04-27 Thread BartlebyScrivener
One way: import socket socket.getaddrinfo(socket.gethostname(), None)[0][4][0] It was the first google hit -- http://mail.python.org/mailman/listinfo/python-list

Re: finding IP address of computer

2006-04-27 Thread Chris
hehe, works a charm, cheers mate. -- http://mail.python.org/mailman/listinfo/python-list

Re: finding IP address of computer

2006-04-27 Thread Jorge Godoy
Chris wrote: hehe, works a charm, cheers mate. Beware that if you have a different entry in your hosts file you can match a different name. Test it: - add 127.0.0.2yourhost.yourdomain yourhost to /etc/hosts - rerun the code. You'll see 127.0.0.2 as the result. So take that into account.

Re: finding IP address of computer

2006-04-27 Thread sturlamolden
print '127.0.0.1' :-P -- http://mail.python.org/mailman/listinfo/python-list

Re: finding IP address of computer

2006-04-27 Thread Grant Edwards
On 2006-04-27, Gregor Horvath [EMAIL PROTECTED] wrote: Chris schrieb: How do I find and print to screen the IP address of the computer my python program is working on? IP adresses are bound to network interfaces not to computers. One Computer can have multiple network interfaces. And each

Re: finding IP address of computer

2006-04-27 Thread Terry Reedy
Grant Edwards [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On 2006-04-27, Gregor Horvath [EMAIL PROTECTED] wrote: Chris schrieb: How do I find and print to screen the IP address of the computer my python program is working on? IP adresses are bound to network interfaces

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']

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

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

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

Re: Windows getting local ip address

2006-03-23 Thread Erno Kuusela
The traditional right way (tm) to do this is to call getsockname() on the (a?) socket that's connected to the guy you want to tell your address to. This picks the right address in case you have several. If you don't have a socket handy, you can make a connectionless UDP socket and connect() it to

Re: Windows getting local ip address

2006-03-23 Thread Arne Ludwig
That man is a genius: s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect((gmail.com,80)) print s.getsockname() ('192.168.0.174', 2768) s.close() Should work on Windows as well. -- http://mail.python.org/mailman/listinfo/python-list

Windows getting local ip address

2006-03-22 Thread SolaFide
On Linux, it is a simple matter to get the local ip address with system.os(ifconfig /tmp/ip); ip=open(/tmp/ip).readlines(), etc. How can I do this with Windows? -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows getting local ip address

2006-03-22 Thread Fredrik Lundh
SolaFide wrote: On Linux, it is a simple matter to get the local ip address with system.os(ifconfig /tmp/ip); ip=open(/tmp/ip).readlines(), etc. ip = os.popen(ifconfig).readlines() is a bit more convenient. How can I do this with Windows? the command is called ipconfig in windows

Re: Windows getting local ip address

2006-03-22 Thread utabintarbo
You can do essentially the same thing substituting ipconfig for ifconfig. Though I am sure there are better ways -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows getting local ip address

2006-03-22 Thread Arne Ludwig
The second solution can give really weird results though, e.g. on my Linux system I get: gethostbyaddr(gethostname()) ('linux.site', ['linux'], ['127.0.0.2']) A more flexible but potentially unportable way would be: import socket import fcntl import struct def get_ip_address(ifname): ...

Re: obtain client ip address from SimpleXMLRPCServer ?

2006-01-29 Thread stuff
Thanks again Peter. I found 2 potential solutions for obtaining the ip address of the incoming connection. The first was to subclass SimpleXMLRPCRequestHandler class and pass it to the SimpleXMLRPCServer constructor. In doing so, I could directly access the client_address via

Re: obtain client ip address from SimpleXMLRPCServer ?

2006-01-27 Thread Peter Gsellmann
[EMAIL PROTECTED] wrote: Thanks for the reply Peter. Can you provide a code snippet for extracting this data. When I print the dir() of the SimpleXMLRPCServer instance I do not see a request_handler attribute or method. this is ok. In the serverclass-object, there is no such method because

Re: obtain client ip address from SimpleXMLRPCServer ?

2006-01-26 Thread stuff
Thanks for the reply Peter. Can you provide a code snippet for extracting this data. When I print the dir() of the SimpleXMLRPCServer instance I do not see a request_handler attribute or method. Phil -- http://mail.python.org/mailman/listinfo/python-list

Re: obtain client ip address from SimpleXMLRPCServer ?

2006-01-24 Thread Peter Gsellmann
[EMAIL PROTECTED] wrote: Is it possible to obtain the client's ip address from a SimpleXMLRPCServer instance or subclass instance? When running SimpleXMLRPCServer with logRequests = 1, the xmlrpc server prints out the fqdn on the console, however, I'm not sure if this information (either

obtain client ip address from SimpleXMLRPCServer ?

2006-01-23 Thread stuff
Is it possible to obtain the client's ip address from a SimpleXMLRPCServer instance or subclass instance? When running SimpleXMLRPCServer with logRequests = 1, the xmlrpc server prints out the fqdn on the console, however, I'm not sure if this information (either fqdn or ip address) is available

Re: Determine the IP address of an eth interface

2006-01-19 Thread Tim Golden
[billie] | Hi all. I'm searching for a module that permits me to | low-level interact | with ethernet interfaces of my system. | I would like to determine at least the first of the followings values: | | 1 - IP address assigned to the interface | 2 - subnet mask | 3 - default gateway | 4

Re: Determine the IP address of an eth interface

2006-01-19 Thread Michael Amrhein
billie wrote: Hi all. I'm searching for a module that permits me to low-level interact with ethernet interfaces of my system. I would like to determine at least the first of the followings values: 1 - IP address assigned to the interface 2 - subnet mask 3 - default gateway 4 - primary

Determine the IP address of an eth interface

2006-01-18 Thread billie
Hi all. I'm searching for a module that permits me to low-level interact with ethernet interfaces of my system. I would like to determine at least the first of the followings values: 1 - IP address assigned to the interface 2 - subnet mask 3 - default gateway 4 - primary and secondary dns 5

Re: Determine the IP address of an eth interface

2006-01-18 Thread Nainto
This may depend on your OS. How about: http://www.inl.fr/nuface-doc/nupyf-doc-en.html#id2457044 -- http://mail.python.org/mailman/listinfo/python-list

How to learn DNS Server's IP address

2005-09-30 Thread Abdullah Yoldas
How can I learn the DNS Server's IP address for my network, programmatically? The idea is to learn DNS Server IP and initialize medusa.resolver accordingly. Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Your IP Address

2005-07-31 Thread Your IP address
html head titleYour IP address/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 style type=text/css !-- body { background-color: ##BBE1DF; } .style1 { font-size: 36px; font-weight: bold; font-family: Verdana, Arial, Helvetica, sans-serif

Re: How to send broadcast message over network and collect all the IP address?

2005-07-18 Thread Sandeep Arya
address? Date: Fri, 15 Jul 2005 17:49:26 +0200 Sandeep Arya wrote: Hello to all Well this is my first mail on this list. I am facing a problem associated with collecting IP address on my network. What i thought is to send broadcast packet over the network and then recieving back the reply

How to send broadcast message over network and collect all the IP address?

2005-07-15 Thread Sandeep Arya
Hello to all Well this is my first mail on this list. I am facing a problem associated with collecting IP address on my network. What i thought is to send broadcast packet over the network and then recieving back the reply from the computers and bridges connected to my network and then adding

Re: How to send broadcast message over network and collect all the IP address?

2005-07-15 Thread Francesco Ciocchetti
Sandeep Arya wrote: Hello to all Well this is my first mail on this list. I am facing a problem associated with collecting IP address on my network. What i thought is to send broadcast packet over the network and then recieving back the reply from the computers and bridges connected to my

Re: Controlling source IP address within urllib2

2005-06-09 Thread Dan
the source IP address of the client.) Of course, I had to weave in some code that allowed me to pass the client IP address through the URLopener class in the urllib library. Everything seems to work so far. John, thanks again for your help. You pointed me in the right direction. -Dan -- http

Re: Controlling source IP address within urllib2

2005-06-08 Thread Dan
, because I would think that overriding the http_open function in the handler would have signaled that this function is capable of handling http. If I call the HTTPHandler base class http_open function from within the derived class, all works okay, but of course, I don't get to use the source IP

Re: Controlling source IP address within urllib2

2005-06-06 Thread Dan
John, Thanks for your input. I can kind of see the light in this, but I'm having difficulty knowing where the do_open method comes from. Also, I'll need to follow redirects, so I assume then I would add a HTTPRedirectHandler instance to the urllib2.build_opener. (?) Thanks again for your help.

Re: Controlling source IP address within urllib2

2005-06-04 Thread John J. Lee
Dan [EMAIL PROTECTED] writes: Does anybody know how to control the source IP address (IPv4) when using the urllib2 library? I have a Linux box with several IP addresses in the same subnet, and I want to simulate several individuals within that subnet accessing web pages independently. I

Controlling source IP address within urllib2

2005-06-03 Thread Dan
Does anybody know how to control the source IP address (IPv4) when using the urllib2 library? I have a Linux box with several IP addresses in the same subnet, and I want to simulate several individuals within that subnet accessing web pages independently. I need the functionality of urllib2

Re: Determine ip address

2005-05-05 Thread ontiscal
http://checkip.tk/ codecraig ha scritto: hi, how can i use python to figure the ip address of the machine which the python script is running on? I dont mean like 127.0.0.1but i want the external IP address (such as ipconfig on windows displays). any ideas?? THanks -- http

Re: Determine ip address

2005-05-05 Thread Mike Meyer
[Format recovered from top-posting.] [EMAIL PROTECTED] writes: codecraig ha scritto: how can i use python to figure the ip address of the machine which the python script is running on? I dont mean like 127.0.0.1but i want the external IP address (such as ipconfig on windows displays

Re: Determine ip address

2005-04-15 Thread rbt
codecraig wrote: hi, how can i use python to figure the ip address of the machine which the python script is running on? I dont mean like 127.0.0.1but i want the external IP address (such as ipconfig on windows displays). any ideas?? THanks To get the public IP (like when you're behind

Re: Determine ip address

2005-04-15 Thread Andy Jeffries
codecraig wrote: hi, how can i use python to figure the ip address of the machine which the python script is running on? I dont mean like 127.0.0.1but i want the external IP address (such as ipconfig on windows displays). I use the following (all on one line): external_ip = os.popen

Re: Determine ip address

2005-04-15 Thread Lee Harr
On 2005-04-15, codecraig [EMAIL PROTECTED] wrote: hi, how can i use python to figure the ip address of the machine which the python script is running on? I dont mean like 127.0.0.1but i want the external IP address (such as ipconfig on windows displays). any ideas?? I use

Re: Determine ip address

2005-04-15 Thread fuzzylollipop
import socket print socket.gethostbyname( socket.gethostname() ) -- http://mail.python.org/mailman/listinfo/python-list

Re: get the IP address of a host

2005-01-07 Thread Jorge Luiz Godoy Filho
Kartic, Quarta 05 Janeiro 2005 14:08, wrote: socket.gethostbyaddr(socket.gethostname()) will return a tuple containing fully qualified hostname, alternative hostnames, ip addresses (1 if multihomed). or socket.gethostbyname(socket.gethostname()) None of these work with computers with

Re: get the IP address of a host

2005-01-06 Thread J Berends
and hostname == socket.gethostname(): # when we want to determine local IP and did not have succes # with gethostbyname_ex then we would like to connect to say... # google.com and determine the local ip address bound to the # local socket. try: s

Re: get the IP address of a host

2005-01-06 Thread Nick Coghlan
J Berends wrote: Lee Harr wrote: Basically, it scrapes the output from ifconfig for the actual address assigned to the interface. Works perfectly on FreeBSD and Linux (given the correct configuration). Nice way, have to device something for windows than. Use the same approach, but scrape the

Re: get the IP address of a host

2005-01-06 Thread P
J Berends wrote: def getipaddr(hostname='default'): [snip] It returns the IP address with which it connects to the world (not lo), might be a pvt LAN address or an internet routed IP. Depend on where the host is. I hate the google trick actually, so any suggestions to something better

Re: get the IP address of a host

2005-01-06 Thread Jp Calderone
and hostname == socket.gethostname(): # when we want to determine local IP and did not have succes # with gethostbyname_ex then we would like to connect to say... # google.com and determine the local ip address bound to the # local socket. try

Re: get the IP address of a host

2005-01-06 Thread J Berends
and hostname == socket.gethostname(): # when we want to determine local IP and did not have succes # with gethostbyname_ex then we would like to connect to say... # google.com and determine the local ip address bound to the # local socket. try: s

get the IP address of a host

2005-01-05 Thread none
I want to determine the outside (non local, a.k.a. 127.0.0.x) ip addresses of my host. It seems that the socket module provides me with some nifty tools for that but I cannot get it to work correctly it seems. Can someone enlightened show a light on this: import socket def

Re: get the IP address of a host

2005-01-05 Thread Kartic
socket.gethostbyaddr(socket.gethostname()) will return a tuple containing fully qualified hostname, alternative hostnames, ip addresses (1 if multihomed). Thanks, --Kartic -- http://mail.python.org/mailman/listinfo/python-list

Re: get the IP address of a host

2005-01-05 Thread Kartic
or socket.gethostbyname(socket.gethostname()) -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4