tests/tinyproxy.py
changeset 27302 faca4adfed0a
parent 25660 328739ea70c3
child 27637 b502138f5faa
equal deleted inserted replaced
27301:5defcb7d6e5f 27302:faca4adfed0a
     1 #!/usr/bin/env python
     1 #!/usr/bin/env python
       
     2 
       
     3 from __future__ import absolute_import
     2 
     4 
     3 __doc__ = """Tiny HTTP Proxy.
     5 __doc__ = """Tiny HTTP Proxy.
     4 
     6 
     5 This module implements GET, HEAD, POST, PUT and DELETE methods
     7 This module implements GET, HEAD, POST, PUT and DELETE methods
     6 on BaseHTTPServer, and behaves as an HTTP proxy.  The CONNECT
     8 on BaseHTTPServer, and behaves as an HTTP proxy.  The CONNECT
    10 Any help will be greatly appreciated.           SUZUKI Hisao
    12 Any help will be greatly appreciated.           SUZUKI Hisao
    11 """
    13 """
    12 
    14 
    13 __version__ = "0.2.1"
    15 __version__ = "0.2.1"
    14 
    16 
    15 import BaseHTTPServer, select, socket, SocketServer, urlparse, os
    17 import BaseHTTPServer
       
    18 import os
       
    19 import select
       
    20 import socket
       
    21 import SocketServer
       
    22 import urlparse
    16 
    23 
    17 class ProxyHandler (BaseHTTPServer.BaseHTTPRequestHandler):
    24 class ProxyHandler (BaseHTTPServer.BaseHTTPRequestHandler):
    18     __base = BaseHTTPServer.BaseHTTPRequestHandler
    25     __base = BaseHTTPServer.BaseHTTPRequestHandler
    19     __base_handle = __base.handle
    26     __base_handle = __base.handle
    20 
    27