AJAX Proxy 0.2

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;

[code lang=”python”]
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;

[code lang=”python”]
# 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

wait:0 wait:1
wait:random wait:random
wait:10 wait:10
wait:0 wait:0
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) …

3 Responses to AJAX Proxy 0.2
  1. […] Ajax Blog – AJAX Proxy 0.2 […]

  2. Simulating Latency with Greasemonkey - Ajax Blog
    September 23, 2005 | 10:09 am

    […] s of lines of code Some random thoughts, perhaps to give Julien ideas. When considering AJAX Proxy had half thought of Greasemonkey although figured an HTTP proxy is a more &#8220 […]

  3. Curiosity is bliss
    September 21, 2005 | 5:43 pm

    XmlHttpRequest – Add Latency

    I found about Harry Fuecks’ AJAX Proxy thru this post on AJAX apps and latency. Network latency is indeed very important to take in account when building a responsive web application, and its easy for developpers using their local webserver to overloo…