Browse Source

Fixed: fail if proxy_auth is None

main
nibrag 8 years ago
parent
commit
32fa3584a3
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      aiosocks/protocols.py

+ 6
- 0
aiosocks/protocols.py View File

@@ -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:


Loading…
Cancel
Save