Skip to content
DatamartLabs
EXP-007
StableOpen source

CGI Proxy

A simple CGI HTTP proxy for Python 2 and 3. Install it with pip.

  • Python
  • HTTP
  • PyPI

CGI Proxy forwards requests from a CGI script and hands back the content, the status code, and the response headers.

  • Sets X-Forwarded-For to the client IP address
  • Passes through the client’s User-Agent
  • Decodes gzip content
  • Prints every error to stderr
  • Uses urllib2 on Python 2 and urllib.request on Python 3
pip install cgiproxy

It exposes do_get, do_head, and do_post, each returning a tuple of content, status code, and headers.