Version 0.2 of of AJAX Proxy is out – available here. This one actually passes on the POST body (duh).
The basic instructions on setting up Python are the same, as described earlier.
Configuration of the script has now changed – at the end of the script you would modify;
if name == ‘main’:
REAL_TIMEOUT = 10 # Timeout between AjaxProxy the remote host
# If you’re behind a proxy server yourself, use these
#PROXY_HOST = ‘proxy.server.com:8080’
#PROXY_USER = ‘yourusername’ # Not required
#PROXY_PASS = ‘yourpassword’ # Required if PROXY_USER is set
LOG_DOMAIN = ‘localhost’ # Restrict logging to this domain
LOG_FAVICON = 0 # Log requests for favicon.ico
PI.load(‘proxy.instructions’) # Load the instructions file
The instructions file allows you to tell the proxy how it should delay requests. An example;
# On each line, enter two instructions seperated by whitespace
# The first is executed after a request has been received by the proxy but before it forwards it
# The second is executed after the response has been fetched by the proxy but before it returns it to the browser
# The available instructions are;
# wait < creates a delay
# – the delay can be specified a colon then an integer (seconds up to 10)
# – or the word "random" for a random delay of 0 – 10 secs
# fail < the request or response fails – nothing delivered
# end < just outputs a message saying it’s the last instruction without interfering with the request for info only
# – use of this is optional
fail # no need to define a response instruction
Each line of instructions is used to apply to a single request / response lifecycle. The next request will use the instructions on the next line.
Otherwise, it now dumps the complete request and response (HTTP headers and body) which can be handy for debugging.
A friendly explaination some other time. Meanwhile it’s interesting to try some of the AJAX applications out there – there’s some tails or madness, rage and data loss waiting to be told ( and JPSpan is not entirely innocent either) …