Browse Source

create_connection may return socks protocol

main
nibrag 8 years ago
parent
commit
0064efbab2
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      aiosocks/__init__.py

+ 4
- 3
aiosocks/__init__.py View File

@@ -61,8 +61,9 @@ async def create_connection(protocol_factory, proxy, proxy_auth, dst, *, remote_
raise SocksError('Can not connect to %s:%s [%s]' %
(dst[0], dst[1], exc))

protocol = protocol_factory()
protocol.connection_made(transport)
transport._protocol = protocol
if protocol_factory:
protocol = protocol_factory()
protocol.connection_made(transport)
transport._protocol = protocol

return transport, protocol

Loading…
Cancel
Save