This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eldonz@atlanticdb.com
Recipients eldonz@atlanticdb.com
Date 2008-09-26.09:58:49
SpamBayes Score 7.406774e-07
Marked as misclassified No
Message-id <1222423132.09.0.32780438264.issue3972@psf.upfronthosting.co.za>
In-reply-to
Content
I updated httplib.py, python 2.4, to be able to bind to a specific IP
address when connecting to a remote site.

  conn = httplib.HTTPConnection('82.94.237.218', 80)

will connect to '82.94.237.218' using one of the local IP addresses. For
example, if a machine has an primary IP address and an alias such as

eth0    192.168.1.10
eth0:1  192.168.1.11

the outbound connection might use either eth0 or eth0:1. I'm not sure
how it picks now. I added a bind option both for http and https so we
can direct the connection through one or the other. For example,

  conn = httplib.HTTPConnection('82.94.237.218', 80, None, None, None,
'192.168.1.10')

would make sure it used 192.168.1.10 not 192.168.1.11.

I ran into this on a server that is contacted by an external legacy
server which requires a reverse connection over the same IP address that
the original connection came in on.
History
Date User Action Args
2008-09-26 09:58:52eldonz@atlanticdb.comsetrecipients: + eldonz@atlanticdb.com
2008-09-26 09:58:52eldonz@atlanticdb.comsetmessageid: <1222423132.09.0.32780438264.issue3972@psf.upfronthosting.co.za>
2008-09-26 09:58:50eldonz@atlanticdb.comlinkissue3972 messages
2008-09-26 09:58:49eldonz@atlanticdb.comcreate