Martijn Faassen wrote:
> Hi there,
> 
> [resending this; I sent it yesterday but it didn't show up. My apologies 
> for any duplicates]
> 
> I'm investigating using WebOb on the client side, as I'm writing a
> client-side library. WebOb can make requests through WSGI, so I'm also
> using WSGI on the client side. So I started looking for a WSGI
> application that can pass requests along to another server.
> 
> I found two possibilities:
> 
> HTTPEncode - semi-released, but not much recent development activity.
> 
> WSGIProxy - unreleased, but recent development activity is a bit younger
> than HTTPEncode.

I need to clean it up, but generally I would recommend WSGIProxy, and 
would not recommend HTTPEncode.  For a client 
wsgiproxy.exactproxy.proxy_exact_request would be the best app, and it's 
the thing least likely to be moved around in WSGIProxy.

> HTTPEncode also includes some other features I might want to use (the
> encoding bit), though I'm not sure yet. I believe it doesn't allow me to
> use WebOb directly, which needs a WSGI application.

Nah... the encoding bit is kind of arcane and I think just isn't right.

> Any (paste or non-paste) possibilities I missed? Is client-side WSGI the
> right direction to go? Anything to watch out for? Which one of these is
> recommended for my use case? Should I worry about the lack of releases?

I think WebOb specifically is a fairly nice client library, though it 
wasn't entirely intentional.  I've used WebTest (based on WebOb) to do 
functional testing over HTTP before in the same manner.

Sometime I'd like to think about some of httplib2's caching and 
validation written as WSGI middleware, to be put in front of 
proxy_exact_request.  I started playing with this 
(http://svn.pythonpaste.org/Paste/CacheMiddleware/trunk) but HTTP 
Caching Is Hard.

> Would it make sense to change HTTPEncode to use WebOb and WSGIProxy?

Maybe rethinking HTTPEncode would make some sense, but it's kind of too 
complex for its own good, especially compared to doing the same things 
natively.  All for a small saving that could be achieved more easily 
with other techniques.  WebOb itself uses some HTTPEncode-like ideas for 
handling the request body, but it's more conservative about it.

-- 
Ian Bicking : [EMAIL PROTECTED] : http://blog.ianbicking.org

_______________________________________________
Paste-users mailing list
[email protected]
http://webwareforpython.org/cgi-bin/mailman/listinfo/paste-users

Reply via email to