From fe77dd35c67a0dfbd3004fefe97c689f8cfd3291 Mon Sep 17 00:00:00 2001 From: Sandor Nemes Date: Fri, 8 Jan 2016 15:46:59 +0100 Subject: Fixed a problem with the bind address not being used as the source address on outgoing TCP packets --- libmproxy/models/connections.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libmproxy/models/connections.py') diff --git a/libmproxy/models/connections.py b/libmproxy/models/connections.py index 0991955d..0cfc17d4 100644 --- a/libmproxy/models/connections.py +++ b/libmproxy/models/connections.py @@ -88,8 +88,10 @@ class ClientConnection(tcp.BaseHandler, stateobject.StateObject): class ServerConnection(tcp.TCPClient, stateobject.StateObject): - def __init__(self, address): - tcp.TCPClient.__init__(self, address) + def __init__(self, address, source_address=None): + if source_address: + source_address = (source_address, 0) + tcp.TCPClient.__init__(self, address, source_address) self.via = None self.timestamp_start = None -- cgit v1.2.3