Ñò ô†³Kc @ s§ d Z d d k Z d d k Z d d k Z d d k l Z d d k l Z d Z d e f d „ ƒ YZ d d d „ Z d e f d „ ƒ YZ d „ Z d d d „ Z d S( sæ An application that proxies WSGI requests to a remote server. TODO: * Send ``Via`` header? It's not clear to me this is a Via in the style of a typical proxy. * Other headers or metadata? I put in X-Forwarded-For, but that's it. * Signed data of non-HTTP keys? This would be for things like REMOTE_USER. * Something to indicate what the original URL was? The original host, scheme, and base path. * Rewriting ``Location`` headers? mod_proxy does this. * Rewriting body? (Probably not on this one -- that can be done with a different middleware that wraps this middleware) * Example:: use = egg:Paste#proxy address = http://server3:8680/exist/rest/db/orgs/sch/config/ allowed_request_methods = GET iÿÿÿÿN( t httpexceptions( t aslists transfer-encodingt connections keep-alives proxy-authenticates proxy-authorizationt tet trailerst upgradet Proxyc B s e Z d d d „ Z d „ Z RS( c C s¿ | | _ t i | ƒ | _ | i d i ƒ | _ | i d | _ | i d | _ g } | D] } | o | | i ƒ q\ q\ ~ | _ g } | D] } | o | | i ƒ q‘ q‘ ~ | _ d S( Ni i i ( t addresst urlparset urlsplitt parsedt lowert schemet hostt patht allowed_request_methodst suppress_http_headers( t selfR R R t _[1]t xt _[2]( ( s/ /usr/lib/python2.6/site-packages/paste/proxy.pyt __init__6 s 5c C s0 | i o1 | d i ƒ | i j o t i d ƒ | | ƒ S| i d j o t i } n: | i d j o t i } n t d | i | i f ƒ ‚ | | i ƒ } h } xx | i ƒ D]j \ } } | i d ƒ oN | d i ƒ i d d ƒ } | d j p | | i j o q³ n | | |