← Back
Editing: socks.cpython-38.pyc
U W[� � @ s� d Z ddlZddlZddlZddlZddlmZmZmZ ddl m Z G dd� dej�ZG dd� dej�Z G d d � d ej�ZG dd� dej�ZG d d� dej�ZdS )z) Implementation of the SOCKSv4 protocol. � N)�reactor�protocol�defer)�logc @ s4 e Zd Zdd� Zdd� Zdd� Zdd� Zd d � ZdS )�SOCKSv4Outgoingc C s || _ d S �N)�socks��selfr � r �9/usr/lib/python3/dist-packages/twisted/protocols/socks.py�__init__ s zSOCKSv4Outgoing.__init__c C s. | j �� }| jjdd|j|jd� | | j_d S )N�Z r )�port�ip)� transport�getPeerr � makeReplyr �host� otherConn)r �peerr r r �connectionMade s zSOCKSv4Outgoing.connectionMadec C s | j j�� d S r �r r �loseConnection�r �reasonr r r �connectionLost s zSOCKSv4Outgoing.connectionLostc C s | j �|� d S r �r �write�r �datar r r �dataReceived# s zSOCKSv4Outgoing.dataReceivedc C s | j �| |� | j�|� d S r �r r r r r r r r r '