[Techtalk] How to write web proxy in Python?

Amanda Babcock alb at quandary.org
Thu Jan 9 16:53:04 EST 2003


Hello all,

I need to write a very simple web proxy that should only do one thing:
replace ^M's with ^J's in incoming pages.  (I think some broken Javascript
with ^M's and no ^J's is preventing me from using my university's online
classes via Opera :(

I have heard that the fastest language to write a webserver in is Python.
I figure the same would be true for a proxy.  I have Python on my box, but
I don't know the language, and I've never done socket programming in any 
language.  I don't require the proxy to accept multiple clients - pages 
will display in one page of the browser, though it does have frames (does 
that make it look like multiple clients?).

If doing this in Python is not as simple as, say, C, that's fine too.
Just need a clue where to start.

(If only I could just write "cat <HTTP input> | sed s/^M/^J/g | <browser>"...)

Amanda
Funny that I'm thinking of writing this in order to take a CMSC 101 class.



More information about the Techtalk mailing list