From 32fa3584a339852d1179301bddb067c360bf36db Mon Sep 17 00:00:00 2001 From: nibrag Date: Fri, 6 May 2016 22:54:05 +0300 Subject: [PATCH] Fixed: fail if proxy_auth is None --- aiosocks/protocols.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aiosocks/protocols.py b/aiosocks/protocols.py index 98b5515..541dda7 100644 --- a/aiosocks/protocols.py +++ b/aiosocks/protocols.py @@ -75,6 +75,9 @@ class Socks4Protocol(SocksProtocol): super().__init__(proxy, proxy_auth, dst, remote_resolve, loop) + if proxy_auth is None: + self._auth = Socks4Auth('') + async def socks_request(self, cmd): # prepare destination addr/port host, port = self._dst_host, self._dst_port @@ -119,6 +122,9 @@ class Socks5Protocol(SocksProtocol): super().__init__(proxy, proxy_auth, dst, remote_resolve, loop) + if proxy_auth is None: + self._auth = Socks5Auth('', '') + async def socks_request(self, cmd): # send available auth methods if self._auth.login and self._auth.password: