# Path: twunnel/proxy_server__https.py
# class HTTPSTunnelOutputProtocol(protocol.Protocol):
# class HTTPSTunnelOutputProtocolFactory(protocol.ClientFactory):
#     def __init__(self):
#     def connectionMade(self):
#     def connectionLost(self, reason):
#     def dataReceived(self, data):
#     def processDataState0(self):
#     def __init__(self, configuration, address, port):
#     def startedConnecting(self, connector):
#     def clientConnectionFailed(self, connector, reason):
#     def clientConnectionLost(self, connector, reason):
# 
# Path: twunnel/proxy_server__socks5.py
# class SOCKS5TunnelOutputProtocol(protocol.Protocol):
# class SOCKS5TunnelOutputProtocolFactory(protocol.ClientFactory):
#     def __init__(self):
#     def connectionMade(self):
#     def connectionLost(self, reason):
#     def dataReceived(self, data):
#     def processDataState0(self):
#     def processDataState1(self):
#     def processDataState2(self):
#     def processDataState3(self):
#     def __init__(self, configuration, address, port):
#     def startedConnecting(self, connector):
#     def clientConnectionFailed(self, connector, reason):
#     def clientConnectionLost(self, connector, reason):


import sys
import os
import base64
import struct
import socket
from twisted.internet import protocol
from twisted.trial import unittest
from twisted.test import proto_helpers
from twunnel import proxy_server__https, proxy_server__socks5
        address = socket.inet_ntop(socket.AF_INET, address)
        
        value = value[6:]
        
        self.assertEqual(address, self.address)
        self.assertEqual(port, self.port)
        
        value = struct.pack("!BBBBIH", 0x05, 0x00, 0x00, 0x01, 0, 0)
        
        self.tunnelOutputProtocol.dataReceived(value)

class SOCKS5TunnelDNTestCase(unittest.TestCase):
    def setUp(self):
        self.configuration = \
        {
            "PROXY_SERVER": 
            {
                "TYPE": "SOCKS5",
                "ADDRESS": "127.0.0.1",
                "PORT": 1080,
                "ACCOUNT": 
                {
                    "NAME": "",
                    "PASSWORD": ""
                }
            }
        }
        self.address = "localhost"
        self.port = 80
        

# Path: twunnel/proxy_server__https.py
# class HTTPSTunnelOutputProtocol(protocol.Protocol):
# class HTTPSTunnelOutputProtocolFactory(protocol.ClientFactory):
#     def __init__(self):
#     def connectionMade(self):
#     def connectionLost(self, reason):
#     def dataReceived(self, data):
#     def processDataState0(self):
#     def __init__(self, configuration, address, port):
#     def startedConnecting(self, connector):
#     def clientConnectionFailed(self, connector, reason):
#     def clientConnectionLost(self, connector, reason):
# 
# Path: twunnel/proxy_server__socks5.py
# class SOCKS5TunnelOutputProtocol(protocol.Protocol):
# class SOCKS5TunnelOutputProtocolFactory(protocol.ClientFactory):
#     def __init__(self):
#     def connectionMade(self):
#     def connectionLost(self, reason):
#     def dataReceived(self, data):
#     def processDataState0(self):
#     def processDataState1(self):
#     def processDataState2(self):
#     def processDataState3(self):
#     def __init__(self, configuration, address, port):
#     def startedConnecting(self, connector):
#     def clientConnectionFailed(self, connector, reason):
#     def clientConnectionLost(self, connector, reason):


# Path: tests/test1.py
import sys
import os
import base64
import struct
import socket
from twisted.internet import protocol
from twisted.trial import unittest
from twisted.test import proto_helpers
from twunnel import proxy_server__https, proxy_server__socks5

        address = socket.inet_ntop(socket.AF_INET, address)
        
        value = value[6:]
        
        self.assertEqual(address, self.address)
        self.assertEqual(port, self.port)
        
        value = struct.pack("!BBBBIH", 0x05, 0x00, 0x00, 0x01, 0, 0)
        
        self.tunnelOutputProtocol.dataReceived(value)

class SOCKS5TunnelDNTestCase(unittest.TestCase):
    def setUp(self):
        self.configuration = \
        {
            "PROXY_SERVER": 
            {
                "TYPE": "SOCKS5",
                "ADDRESS": "127.0.0.1",
                "PORT": 1080,
                "ACCOUNT": 
                {
                    "NAME": "",
                    "PASSWORD": ""
                }
            }
        }
        self.address = "localhost"
        self.port = 80
        

        self.tunnelOutputProtocolFactory = proxy_server__socks5.SOCKS5TunnelOutputProtocolFactory(self.configuration, self.address, self.port)