mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
set source_address if not manually specified
This commit is contained in:
parent
ec628bc37d
commit
4bf7f3c0ff
@ -319,6 +319,8 @@ class TCPClient(_Connection):
|
||||
if self.source_address:
|
||||
connection.bind(self.source_address())
|
||||
connection.connect(self.address())
|
||||
if not self.source_address:
|
||||
self.source_address = Address(connection.getsockname())
|
||||
self.rfile = Reader(connection.makefile('rb', self.rbufsize))
|
||||
self.wfile = Writer(connection.makefile('wb', self.wbufsize))
|
||||
except (socket.error, IOError), err:
|
||||
|
Loading…
Reference in New Issue
Block a user