Example #1
0
    def __init__(self, client_socket, address, config):
        ""
        self.config = config

        self.ntlm_auther = ntlm_auth.ntlm_auther()
        # experimental code
        self.basic_auther = basic_auth.basic_auther()
        # experimental code end

        self.proxy_authorization_tried = 0
        self.www_authorization_tried = 0
        self.tunnel_mode = 0

        # define log files
        self.logger_bin_client = logger.Logger("%s-%d.bin.client" % address, self.config["DEBUG"]["BIN_DEBUG"])
        self.logger_bin_rserver = logger.Logger("%s-%d.bin.rserver" % address, self.config["DEBUG"]["BIN_DEBUG"])
        self.logger_auth = logger.Logger("%s-%d.auth" % address, self.config["DEBUG"]["AUTH_DEBUG"])
        self.logger = logger.Logger("%s-%d" % address, self.config["DEBUG"]["DEBUG"])

        # set it to 1 till we will connect actually???
        # No!!! In that case we have unexpected exit if the client sends its header slow.
        self.rserver_socket_closed = 1  # Yes !
        # This is a flag that means that we have not tried connecting to
        # the remote host. And self.rserver_socket_closed = 1 is not requiring
        # to finish thread.
        # Do not like this solution.
        self.first_run = 1
        self.client_socket_closed = 0
        self.stop_request = 0  # must finish thread

        self.current_rserver_net_location = ""

        self.rserver_socket = None
        self.client_socket = client_socket

        self.client_address = address

        self.rserver_head_obj = None
        self.rserver_current_data_pos = 0
        self.rserver_all_got = 0
        self.rserver_data_length = 0
        self.rserver_header_sent = 0
        self.rserver_data_sent = 0
        self.rserver_buffer = ""

        self.client_head_obj = None
        self.client_current_data_pos = 0
        self.client_all_got = 0
        self.client_data_length = 0
        self.client_header_sent = 0
        self.client_data_sent = 0
        self.client_buffer = ""
        self.client_sent_data = ""

        # init record to debug_log
        self.logger.log(
            "%s Version %s\n"
            % (time.strftime("%d.%m.%Y %H:%M:%S", time.localtime(time.time())), self.config["GENERAL"]["VERSION"])
        )
Example #2
0
    def __init__(self, client_socket, address, config):
        ""     
        self.config = config
        self.ntlm_auther = ntlm_auth.ntlm_auther()
        # experimental code
        self.basic_auther = basic_auth.basic_auther()
        # experimental code end

        self.proxy_authorization_tried = 0
        self.www_authorization_tried = 0
        self.tunnel_mode = 0

        # define log files
        self.logger_bin_client = logger.Logger('%s-%d.bin.client' % address, self.config['DEBUG']['BIN_DEBUG'])
        self.logger_bin_rserver = logger.Logger('%s-%d.bin.rserver' % address, self.config['DEBUG']['BIN_DEBUG'])
        self.logger_auth = logger.Logger('%s-%d.auth' % address, self.config['DEBUG']['AUTH_DEBUG'])
        self.logger = logger.Logger('%s-%d' % address, self.config['DEBUG']['DEBUG'])

        # set it to 1 till we will connect actually???
        # No!!! In that case we have unexpected exit if the client sends its header slow.
        self.rserver_socket_closed = 1  # Yes !
        # This is a flag that means that we have not tried connecting to
        # the remote host. And self.rserver_socket_closed = 1 is not requiring
        # to finish thread.
        # Do not like this solution.
        self.first_run = 1
        self.client_socket_closed = 0
        self.stop_request = 0        # must finish thread

        self.current_rserver_net_location = ''

        self.rserver_socket = None
        self.client_socket = client_socket

        self.client_address = address

        self.rserver_head_obj = None
        self.rserver_current_data_pos =0
        self.rserver_all_got = 0
        self.rserver_data_length = 0
        self.rserver_header_sent = 0
        self.rserver_data_sent = 0
        self.rserver_buffer = ''

        self.client_head_obj = None
        self.client_current_data_pos =0
        self.client_all_got = 0
        self.client_data_length = 0
        self.client_header_sent = 0
        self.client_data_sent = 0
        self.client_buffer = ''
        self.client_sent_data = ''

        # init record to debug_log
        self.logger.log('%s Version %s\n' % (time.strftime('%d.%m.%Y %H:%M:%S', time.localtime(time.time())), self.config['GENERAL']['VERSION']))
    def __init__(self, client_socket, address, config, locking_required, parent_lock=None, parent_lock_list=None):
        # Defaults for function overrides:
        self.connect_rserver = self.proxy_connect_rserver
        self.fix_client_header = self.proxy_fix_client_header
        self.check_connected_remote_server = self.proxy_check_connected_remote_server

        self.locking_required = locking_required
        self.parent_lock = parent_lock
        self.parent_lock_list = parent_lock_list
        self.config = config

        self.ntlm_auther = ntlm_auth.ntlm_auther()
        # experimental code
        self.basic_auther = basic_auth.basic_auther()
        self.digest_auther = digest_auth.digest_auther()
        # experimental code end
        self.proxy_authorization_tried = 0
        self.www_authorization_tried = 0
        self.tunnel_mode = 0

        # define log files
        self.logger_bin_client = logger.Logger('%s-%d.bin.client' % address, self.config['DEBUG']['BIN_DEBUG'])
        self.logger_bin_rserver = logger.Logger('%s-%d.bin.rserver' % address, self.config['DEBUG']['BIN_DEBUG'])
        self.logger_auth = logger.Logger('%s-%d.auth' % address, self.config['DEBUG']['AUTH_DEBUG'])
        self.logger = logger.Logger('%s-%d' % address, self.config['DEBUG']['DEBUG'])

        # set it to 1 till we will connect actually???
        # No!!! In that case we have unexpected exit if the client sends its header slow.
        self.rserver_socket_closed = 1  # Yes !
        # This is a flag that means that we have not tried connecting to
        # the remote host. And self.rserver_socket_closed = 1 is not requiring
        # to finish thread.
        # Do not like this solution.
        self.first_run = 1
        self.client_socket_closed = 0
        self.stop_request = 0        # must finish thread

        self.current_rserver_net_location = ''

        self.rserver_socket = None
        self.client_socket = client_socket

        self.client_address = address

        self.rserver_head_obj = None
        self.rserver_current_data_pos =0
        self.rserver_all_got = 0
        self.rserver_data_length = 0
        self.rserver_header_sent = 0
        self.rserver_data_sent = 0
        self.rserver_buffer = ''

        self.client_head_obj = None
        self.client_current_data_pos =0
        self.client_all_got = 0
        self.client_data_length = 0
        self.client_header_sent = 0
        self.client_data_sent = 0
        self.client_buffer = ''
        self.client_sent_data = ''

        # init record to debug_log
        self.logger.log('%s Version %s\n' % (time.strftime('%d.%m.%Y %H:%M:%S', time.localtime(time.time())), self.config['GENERAL']['VERSION']))