diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-09-27 00:46:54 -0700 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-09-27 00:46:54 -0700 |
commit | 24ceb0f7ac23da5a8cdbc58433315f00b816486c (patch) | |
tree | 122449add5258fae9da391960a863c522d13b512 /netlib | |
parent | ebccc103d83959123d39efe6803a9c24b7da0951 (diff) | |
download | mitmproxy-24ceb0f7ac23da5a8cdbc58433315f00b816486c.tar.gz mitmproxy-24ceb0f7ac23da5a8cdbc58433315f00b816486c.tar.bz2 mitmproxy-24ceb0f7ac23da5a8cdbc58433315f00b816486c.zip |
allow socket creation monkeypatchs
Diffstat (limited to 'netlib')
-rw-r--r-- | netlib/tcp.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/netlib/tcp.py b/netlib/tcp.py index eea10425..b1a6db5a 100644 --- a/netlib/tcp.py +++ b/netlib/tcp.py @@ -727,9 +727,13 @@ class TCPClient(_Connection): self.rfile.set_descriptor(self.connection) self.wfile.set_descriptor(self.connection) + def makesocket(self): + # some parties (cuckoo sandbox) need to hook this + return socket.socket(self.address.family, socket.SOCK_STREAM) + def connect(self): try: - connection = socket.socket(self.address.family, socket.SOCK_STREAM) + connection = self.makesocket() if self.spoof_source_address: try: |