improve proxy.py socket override using nested function def
This commit is contained in:
parent
18223a40ef
commit
6421cb6118
1 changed files with 4 additions and 5 deletions
|
@ -32,8 +32,7 @@ class Module(ModuleManager.BaseModule):
|
||||||
type, proxy_parsed.hostname, proxy_parsed.port)
|
type, proxy_parsed.hostname, proxy_parsed.port)
|
||||||
|
|
||||||
def _socket_factory(self, ptype, phost, pport):
|
def _socket_factory(self, ptype, phost, pport):
|
||||||
return lambda host, port, bind, timeout: self._make_socket(
|
def _(host, port, bind, timeout):
|
||||||
ptype, phost, pport, host, port, bind, timeout)
|
return socks.create_connection((host, port), timeout, bind,
|
||||||
def _make_socket(self, ptype, phost, pport, host, port, bind, timeout):
|
ptype, phost, pport)
|
||||||
return socks.create_connection((host, port), timeout, bind,
|
return _
|
||||||
ptype, phost, pport)
|
|
||||||
|
|
Loading…
Reference in a new issue