|
|
|
@ -1,3 +1,8 @@
|
|
|
|
|
"""
|
|
|
|
|
src/network/socks4a.py
|
|
|
|
|
=================================
|
|
|
|
|
"""
|
|
|
|
|
# pylint: disable=attribute-defined-outside-init
|
|
|
|
|
import socket
|
|
|
|
|
import struct
|
|
|
|
|
|
|
|
|
@ -82,7 +87,7 @@ class Socks4aConnection(Socks4a):
|
|
|
|
|
self.append_write_buf(self.ipaddr)
|
|
|
|
|
except socket.error:
|
|
|
|
|
# Well it's not an IP number, so it's probably a DNS name.
|
|
|
|
|
if Proxy._remote_dns:
|
|
|
|
|
if self._remote_dns:
|
|
|
|
|
# Resolve remotely
|
|
|
|
|
rmtrslv = True
|
|
|
|
|
self.ipaddr = None
|
|
|
|
@ -118,6 +123,7 @@ class Socks4aResolver(Socks4a):
|
|
|
|
|
Socks4a.__init__(self, address=(self.host, self.port))
|
|
|
|
|
|
|
|
|
|
def state_auth_done(self):
|
|
|
|
|
"""Request connection to be made"""
|
|
|
|
|
# Now we can request the actual connection
|
|
|
|
|
self.append_write_buf(
|
|
|
|
|
struct.pack('>BBH', 0x04, 0xF0, self.destination[1]))
|
|
|
|
|