diff options
| author | 2019-10-28 18:11:57 +0000 | |
|---|---|---|
| committer | 2019-10-28 18:11:57 +0000 | |
| commit | 6421cb6118c0bb95f29a7890015534ff1d41def3 (patch) | |
| tree | 1f69dc33a994c2971dd876d76ec61f3a5676ca3f /modules/proxy.py | |
| parent | use the same formatting for "confidential_note" as "note" (diff) | |
| signature | ||
improve proxy.py socket override using nested function def
Diffstat (limited to 'modules/proxy.py')
| -rw-r--r-- | modules/proxy.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/proxy.py b/modules/proxy.py index c66710c8..1bcaebd1 100644 --- a/modules/proxy.py +++ b/modules/proxy.py @@ -32,8 +32,7 @@ class Module(ModuleManager.BaseModule): type, proxy_parsed.hostname, proxy_parsed.port) def _socket_factory(self, ptype, phost, pport): - return lambda host, port, bind, timeout: self._make_socket( - ptype, phost, pport, host, port, bind, timeout) - def _make_socket(self, ptype, phost, pport, host, port, bind, timeout): - return socks.create_connection((host, port), timeout, bind, - ptype, phost, pport) + def _(host, port, bind, timeout): + return socks.create_connection((host, port), timeout, bind, + ptype, phost, pport) + return _ |
