Ñò ô†³Kc @s§dZddkZddkZddkZddklZddklZdZd e fd„ƒYZ ddd„Z de fd„ƒYZ d„Z ddd„ZdS(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(thttpexceptions(tasliststransfer-encodingt connections keep-alivesproxy-authenticatesproxy-authorizationttettrailerstupgradetProxycBs eZddd„Zd„ZRS(cCs¿||_ti|ƒ|_|idiƒ|_|id|_|id|_g}|D]}|o||iƒq\q\~|_g}|D]}|o||iƒq‘q‘~|_ dS(Niii( taddressturlparseturlsplittparsedtlowertschemethosttpathtallowed_request_methodstsuppress_http_headers(tselfRRRt_[1]txt_[2]((s//usr/lib/python2.6/site-packages/paste/proxy.pyt__init__6s 5cCs0|io1|diƒ|ijotidƒ||ƒS|idjo ti}n:|idjo ti}ntd|i |ifƒ‚||i ƒ}h}xx|i ƒD]j\}}|i dƒoN|diƒi dd ƒ}|d jp||ijoq³n|||(t __class__RLthextidRQRR(R((s//usr/lib/python2.6/site-packages/paste/proxy.pyt__repr__²s cCs|d}|idjo |}n |i}|djo ti}n+|djo ti}ntd|ƒ‚d|jotdƒ‚n|d}|idjo |}n |i}||ƒ}h} xT|iƒD]F\} } | idƒo*| di ƒi d d ƒ} | | | R?R t conn_schemeR@R t conn_hostRARBRCRDRFRERRIRJR9((s//usr/lib/python2.6/site-packages/paste/proxy.pyRK¸sp                           N(RLRMt__doc__R<RRVRK(((s//usr/lib/python2.6/site-packages/paste/proxy.pyRPs   cCsg}x÷|iD]ì}|pqn|diƒo[|ptd|ƒ‚n|iƒ\}}|d|iƒ}|i||fƒqny|iddƒ\}}Wntd|ƒ‚nX|iƒ}|iƒtjo|i||fƒqqW|S(sB Turn a Message object into a list of WSGI-style headers. is%First header starts with a space (%r)t t:isInvalid header: %r( RBtisspaceR)tpoptstriptappendtsplitR tfiltered_headers(tmessageRJt full_headert last_headert last_valueRDtheader((s//usr/lib/python2.6/site-packages/paste/proxy.pyR7ùs*  RcCstd|d|ƒS(s Create a proxy that connects to a specific host, but does absolutely no other filtering, including the Host header. RQRR(RP(RNRQRR((s//usr/lib/python2.6/site-packages/paste/proxy.pytmake_transparent_proxys (stransfer-encodingRs keep-alivesproxy-authenticatesproxy-authorizationRRR(R\R&RR2tpasteRtpaste.util.convertersRRdtobjectRRORPR7R<Rj(((s//usr/lib/python2.6/site-packages/paste/proxy.pyts&   Q \