Add HTTP proxy support to post-review

Review Request #379 — Created May 7, 2008 and discarded

Information

Review Board SVN (deprecated)

Reviewers

In our environment we sometimes need the ability to post reviews through an HTTP proxy. This change adds support for an HTTP proxy that is specified either as HTTP_PROXY in the .reviewboardrc file or as --http-proxy on the commandline.

The change is bigger than it should be; it is this way to maintain backwards compatibility with the very flexible way we go about finding REVIEWBOARD_URL in any of many .reviewboardrc files. If we could assume that there is only ever one .reviewboardrc we could simplify the config loading.

This patch is based on a slightly older post-review version. If there is buy-in for this approach I'll apply this patch to a newer version of post-review and update.

post-review continues to work without specifying a proxy.
I have tested specifying a proxy both in .reviewboardrc as HTTP_PROXY and on the commandline using --http-proxy going through a plain old squid HTTP proxy.
JA
  1. hmm.. apparently I put a a comment and it doesn't show up for me... so trying again with review...
    Don't know if there is a generic way to specify comments but here goes.
    
    Proxy server support already works 'out of the box' if you set http_proxy in the environment, i.e. 
    "set http_proxy=http://some-proxy-serve:8080"
    
    This is because the python urllib already looks at the http_proxy environment variable.
    
    I tested that just yesterday ;)
    
    1. Yeah, I think it's silly to add code to post-review to handle this case -- a lot of other tools assume the existence of the http_proxy environment variable.
      
      I don't know if there's something different for windows hosts, but it seems like if there is, urllib should handle that internally, too.
  2. Don't know if there is a generic way to specify comments but here goes.
    
    Proxy server support already works 'out of the box' if you set http_proxy in the environment, i.e. 
    "set http_proxy=http://some-proxy-serve:8080"
    
    This is because the python urllib already looks at the http_proxy environment variable.
    
    I tested that just yesterday ;)
  3. 
      
Loading...