Module Expr Str Import alias Import alias Import alias ImportFrom alias alias alias ImportFrom alias ImportFrom alias FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore SubscriptLoad NameLoad Index Num If CompareNotEq SubscriptLoad NameLoad Index Num BoolOpOr BoolOpAnd NameLoad Num Num body Assign NameStore BinOpMod Str TupleLoad NameLoad SubscriptLoad NameLoad Index Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Str attr TupleLoad BinOpMod Str Call NameLoad NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body If NameLoad body Assign NameStore NameLoad orelse Assign NameStore NameLoad While NameLoad body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If UnaryOpNot NameLoad body Break Expr Call NameLoad NameLoad NameLoad If NameLoad body Expr Call NameLoad NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body TryExcept body While NameLoad body Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Assign NameStore CompareEq AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad Call NameLoad AttributeLoad NameLoad attr Num keyword NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Str If CompareIn Str NameLoad body Delete SubscriptDel NameLoad Index Str Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Str Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore BinOpMod Str Call AttributeLoad Str attr Call NameLoad NameLoad Call AttributeLoad NameLoad attr Assign NameStore ListLoad BinOpMod Str TupleLoad Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr ListComp BinOpMod Str TupleLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call NameLoad BinOpAdd Call AttributeLoad Str attr NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call NameLoad NameLoad NameLoad Call AttributeLoad NameLoad attr handlers ExceptHandler type TupleLoad AttributeLoad NameLoad attr NameLoad NameLoad body Pass decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str If CompareLtE NameLoad Num body Return Assign TupleStore NameStore NameStore TupleLoad SubscriptLoad NameLoad Slice NameLoad SubscriptLoad NameLoad Slice NameLoad If Call AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore Call NameLoad NameLoad Num Assign NameStore BinOpMod Str SubscriptLoad NameLoad Index Num Return Dict Str Str Str NameLoad NameLoad Str Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareNotEq NameLoad NameLoad body Return Dict Str Str If UnaryOpNot Call AttributeLoad NameLoad attr body Return Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Assign NameStore CompareEq AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr Num Return Dict Str Str NameLoad NameLoad decorator_list
N/A N/A  simple proxy that can be used behind a browser. 
This example require http_parser module:

    pip install http_parser

 N/A io N/A urlparse N/A socket http_parser.http HttpStream NoMoreData ParserError http_parser.parser HttpParser tproxy.util parse_address get_host N/A N/A addr is_ssl N/A False N/A N/A  return a correct Host header  N/A host N/A addr N/A 0 N/A N/A N/A addr N/A 1 N/A N/A is_ssl 443 80 N/A N/A host N/A %s:%s N/A host N/A addr N/A 1 N/A host N/A write_chunk N/A N/A to data N/A N/A N/A  send a chunk encoded  N/A chunk N/A N/A join N/A N/A %X
 N/A len data data N/A N/A N/A to writeall chunk N/A write N/A N/A to data N/A N/A N/A N/A N/A to writeall data N/A send_body N/A N/A to body chunked N/A False N/A N/A chunked N/A N/A _write write_chunk N/A N/A _write write N/A True N/A N/A data N/A N/A body read N/A io DEFAULT_BUFFER_SIZE N/A N/A data N/A N/A N/A N/A _write to data N/A chunked N/A N/A N/A _write to N/A rewrite_request N/A N/A req N/A N/A N/A N/A N/A True N/A N/A parser N/A HttpStream req N/A headers N/A N/A parser headers N/A parsed_url N/A N/A urlparse urlparse N/A N/A parser url N/A is_ssl N/A N/A parsed_url scheme https N/A host N/A get_host N/A parse_address N/A parsed_url netloc 80 is_ssl is_ssl N/A N/A headers N/A Host host N/A N/A headers N/A Connection close N/A N/A Proxy-Connection headers N/A N/A N/A headers N/A Proxy-Connection N/A location N/A N/A urlparse urlunparse N/A N/A parsed_url path N/A parsed_url params N/A parsed_url query N/A parsed_url fragment N/A httpver N/A HTTP/%s N/A N/A . join N/A map str N/A N/A parser version N/A new_headers N/A N/A %s %s %s
 N/A N/A N/A parser method location httpver N/A N/A N/A new_headers extend N/A N/A %s: %s
 N/A hname hvalue N/A N/A hname hvalue N/A N/A headers items N/A N/A N/A req writeall N/A bytes N/A N/A N/A join new_headers N/A body N/A N/A parser body_file N/A N/A send_body req body N/A N/A parser is_chunked N/A N/A N/A N/A N/A socket error NoMoreData ParserError N/A N/A N/A proxy N/A N/A data N/A N/A N/A recved N/A len data N/A idx N/A N/A data find N/A N/A idx 0 N/A N/A N/A N/A line rest N/A N/A data N/A idx N/A data N/A idx N/A N/A N/A line startswith CONNECT N/A N/A parts N/A N/A line split None N/A netloc N/A parts N/A 1 N/A remote N/A parse_address netloc 80 N/A reply_msg N/A %s 200 OK

 N/A parts N/A 2 N/A N/A remote reply data remote reply_msg N/A parser N/A HttpParser N/A parsed N/A N/A parser execute data recved N/A N/A parsed recved N/A N/A N/A close HTTP/1.0 502 Gateway Error

Error parsing request N/A N/A N/A N/A parser get_url N/A N/A N/A parsed_url N/A N/A urlparse urlparse N/A N/A parser get_url N/A is_ssl N/A N/A parsed_url scheme https N/A remote N/A parse_address N/A parsed_url netloc 80 N/A N/A remote ssl remote is_ssl N/A