class documentation

class twisted.protocols.socks.SOCKSv4(protocol.Protocol): (source)

View In Hierarchy

An implementation of the SOCKSv4 protocol.

Instance Variable logging If not None, the name of the logfile to which connection information will be written.
Instance Variable reactor The reactor used to create connections.
Instance Variable buf Part of a SOCKSv4 connection request.
Instance Variable otherConn Until the connection has been established, otherConn is None. After that, it is the proxy-to-destination protocol instance along which the client's connection is being forwarded.
Method __init__ Undocumented
Method connectionMade Called when a connection is made.
Method dataReceived Called whenever data is received.
Method connectionLost Called when the connection is shut down.
Method authorize Undocumented
Method connectClass Undocumented
Method listenClass Undocumented
Method makeReply Undocumented
Method write Undocumented
Method log Undocumented
Method _dataReceived2 The second half of the SOCKS connection setup. For a SOCKSv4 packet this is after the server address has been extracted from the header. For a SOCKSv4a packet this is after the host name has been resolved.

Inherited from Protocol:

Class Variable factory Undocumented
Method logPrefix Return a prefix matching the class name, to identify log messages related to this protocol instance.

Inherited from BaseProtocol (via Protocol):

Instance Variable connected Undocumented
Instance Variable transport Undocumented
Method makeConnection Make a connection to a transport and a server.
logging = (source)
If not None, the name of the logfile to which connection information will be written.
(type: str or None)
reactor = (source)
The reactor used to create connections.
(type: object providing twisted.internet.interfaces.IReactorTCP)
Part of a SOCKSv4 connection request.
(type: str)
otherConn = (source)
Until the connection has been established, otherConn is None. After that, it is the proxy-to-destination protocol instance along which the client's connection is being forwarded.
(type: SOCKSv4Incoming, SOCKSv4Outgoing or None)
def __init__(self, logging=None, reactor=reactor): (source)

Undocumented

def connectionMade(self): (source)

Called when a connection is made.

This may be considered the initializer of the protocol, because it is called when the connection is completed. For clients, this is called once the connection to the server has been established; for servers, this is called after an accept() call stops blocking and a socket has been received. If you need to send any greeting or initial message, do it here.

def dataReceived(self, data): (source)

Called whenever data is received.

ParametersdataPart or all of a SOCKSv4 packet. (type: bytes)
def _dataReceived2(self, server, user, version, code, port): (source)

The second half of the SOCKS connection setup. For a SOCKSv4 packet this is after the server address has been extracted from the header. For a SOCKSv4a packet this is after the host name has been resolved.

ParametersserverThe IP address of the destination, represented as a dotted quad. (type: str)
userThe username associated with the connection. (type: str)
versionThe SOCKS protocol version number. (type: int)
codeThe comand code. 1 means establish a TCP/IP stream connection, and 2 means establish a TCP/IP port binding. (type: int)
portThe port number associated with the connection. (type: int)
def connectionLost(self, reason): (source)

Called when the connection is shut down.

Clear any circular references here, and any external references to this Protocol. The connection has been closed.

ParametersreasonUndocumented (type: twisted.python.failure.Failure)
def authorize(self, code, server, port, user): (source)

Undocumented

def connectClass(self, host, port, klass, *args): (source)

Undocumented

def listenClass(self, port, klass, *args): (source)

Undocumented

def makeReply(self, reply, version=0, port=0, ip='0.0.0.0'): (source)

Undocumented

def write(self, data): (source)

Undocumented

def log(self, proto, data): (source)

Undocumented

API Documentation for Twisted, generated by pydoctor 20.12.1 at 2021-02-28 19:53:36.