Webware / localhost vs. real IP address

P

Patrick Useldinger

Hi all,

I'm not sure whether this is Webware or Python-related, but I have to
start somewhere.

I have a small Webware server running on port 8086, with Webware's http
server listening to port 8080 (all standard). The IP address of my
machine is 192.168.1.2, and it's running WinXP.

If I point my Opera to 127.0.0.1:8080, all works well. If I do the same
with 192.168.1.2:8080, which should be the same, it says 'could not
connect to remote server'.

A short Python http client will work with the first address, and says
the follwing when pointed to the second:
Traceback (most recent call last):
File
"C:\Programs\Python23\lib\site-packages\Pythonwin\pywin\framework\scriptutils.py",
line 310, in RunScript
exec codeObject in __main__.__dict__
File "C:\prj\dynip\myselfhttp.py", line 11, in ?
router.request('GET','/')
File "C:\Programs\Python23\Lib\httplib.py", line 718, in request
self._send_request(method, url, body, headers)
File "C:\Programs\Python23\Lib\httplib.py", line 739, in _send_request
self.endheaders()
File "C:\Programs\Python23\Lib\httplib.py", line 712, in endheaders
self._send_output()
File "C:\Programs\Python23\Lib\httplib.py", line 597, in _send_output
self.send(msg)
File "C:\Programs\Python23\Lib\httplib.py", line 564, in send
self.connect()
File "C:\Programs\Python23\Lib\httplib.py", line 548, in connect
raise socket.error, msg
error: (10061, 'Connection refused')

The local firewall has been disabled.

The routes seem to be OK as well:
C:\Documents and Settings\pu>route print
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 80 ad 0b 16 22 ...... CNet PRO200 PCI Fast Ethernet Adapter -
Packet Scheduler Miniport
===========================================================================
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface
Metric
0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.2
30
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1
1
192.168.1.0 255.255.255.0 192.168.1.2 192.168.1.2
30
192.168.1.2 255.255.255.255 127.0.0.1 127.0.0.1
30
192.168.1.255 255.255.255.255 192.168.1.2 192.168.1.2
30
224.0.0.0 240.0.0.0 192.168.1.2 192.168.1.2
30
255.255.255.255 255.255.255.255 192.168.1.2 192.168.1.2
1
Default Gateway: 192.168.1.1
===========================================================================
Persistent Routes:
None

Any clues?

Regards,
-PU
 
D

Diez B. Roggisch

Hi,
If I point my Opera to 127.0.0.1:8080, all works well. If I do the same
with 192.168.1.2:8080, which should be the same, it says 'could not
connect to remote server'.
Any clues?

Yes - sockets that are connected to '' listen to all local addresses, while
localhost listens only to 127.0.0.1 - this is somewhat misleading described
in the socket module. So I guess you should configure webware in a way that
its listening on '', not on localhost.
 
P

Patrick Useldinger

Yes - sockets that are connected to '' listen to all local addresses, while
localhost listens only to 127.0.0.1 - this is somewhat misleading described
in the socket module. So I guess you should configure webware in a way that
its listening on '', not on localhost.

I was mislead by the fact that 127.0.0.1 == 192.168.1.2 in my case.
While this is logically true, the addresses are obviously still
considered physically different
Thank you.

-PU
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top