Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tv42/munging_http_proxy
Munging HTTP proxy, with a simple interactive mode as demo
https://github.com/tv42/munging_http_proxy
Last synced: 20 days ago
JSON representation
Munging HTTP proxy, with a simple interactive mode as demo
- Host: GitHub
- URL: https://github.com/tv42/munging_http_proxy
- Owner: tv42
- License: mit
- Created: 2011-08-09T16:24:01.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2011-08-09T17:10:16.000Z (over 13 years ago)
- Last Synced: 2024-10-16T02:08:00.465Z (2 months ago)
- Language: Python
- Homepage:
- Size: 97.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
=======================================================
Munging HTTP Proxy -- Manipulate HTTP requests easily
=======================================================``munging_http_proxy`` lets you easily modify or intercept HTTP
requests passing through the proxy. All you need to do is write a
Python function that takes a WebOb_ ``Request``, and either mutates it
and returns ``None`` (request will be passed on, and the response from
the server relayed to the client), or directly returns a suitable
WebOb ``Response`` (server will never be contacted)... _WebOb: http://webob.org/
Note that some of the fields of a WebOb ``Request`` are read-only
properties. For example, you cannot set ``req.path``, you'll have to
set ``req.path_info`` and/or ``req.script_name``.``munging_http_proxy`` also contains an interactive mode, where every
request is explorable in an interactive Python session. In this mode,
use ``req`` to access the ``Request``, and set ``resp`` if you wish to
directly return a specific ``Response``. For convenience, any other
variables you set are remembered between the requests.To get started, type::
./bootstrap
And for interactive mode, type::
./virtualenv/bin/interactive-http-proxy
Now you can make requests using the HTTP proxy. For example (in
another window)::http_proxy=http://localhost:8088/ wget -nv -O- 'http://example.com/'