tests/tinyproxy.py
changeset 16703 7292a4618f46
parent 16300 74e114ac6ec1
child 18519 ca430fb6a668
equal deleted inserted replaced
16702:1751d96d324f 16703:7292a4618f46
    45             host_port = netloc, 80
    45             host_port = netloc, 80
    46         print "\t" "connect to %s:%d" % host_port
    46         print "\t" "connect to %s:%d" % host_port
    47         try: soc.connect(host_port)
    47         try: soc.connect(host_port)
    48         except socket.error, arg:
    48         except socket.error, arg:
    49             try: msg = arg[1]
    49             try: msg = arg[1]
    50             except: msg = arg
    50             except (IndexError, TypeError): msg = arg
    51             self.send_error(404, msg)
    51             self.send_error(404, msg)
    52             return 0
    52             return 0
    53         return 1
    53         return 1
    54 
    54 
    55     def do_CONNECT(self):
    55     def do_CONNECT(self):