mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 08:11:00 +00:00
allow socket creation monkeypatchs
This commit is contained in:
parent
ebccc103d8
commit
24ceb0f7ac
@ -727,9 +727,13 @@ class TCPClient(_Connection):
|
|||||||
self.rfile.set_descriptor(self.connection)
|
self.rfile.set_descriptor(self.connection)
|
||||||
self.wfile.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):
|
def connect(self):
|
||||||
try:
|
try:
|
||||||
connection = socket.socket(self.address.family, socket.SOCK_STREAM)
|
connection = self.makesocket()
|
||||||
|
|
||||||
if self.spoof_source_address:
|
if self.spoof_source_address:
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user