aboutsummaryrefslogtreecommitdiffstats
path: root/netlib
diff options
context:
space:
mode:
authorThomas Kriechbaumer <Kriechi@users.noreply.github.com>2016-09-27 10:03:41 +0200
committerGitHub <noreply@github.com>2016-09-27 10:03:41 +0200
commit160f1583723b4866cb77b440fbb76fea40455fd4 (patch)
tree0327c06d15df5f5ce43a381136a1ca60c97a0d5f /netlib
parente0f9aef89ca572475ab471c1961fc32533c5bac8 (diff)
parent24ceb0f7ac23da5a8cdbc58433315f00b816486c (diff)
downloadmitmproxy-160f1583723b4866cb77b440fbb76fea40455fd4.tar.gz
mitmproxy-160f1583723b4866cb77b440fbb76fea40455fd4.tar.bz2
mitmproxy-160f1583723b4866cb77b440fbb76fea40455fd4.zip
Merge pull request #1583 from mhils/patch-makesocket
allow socket creation monkeypatchs
Diffstat (limited to 'netlib')
-rw-r--r--netlib/tcp.py6
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: