Sharing my Python proxy experiment
Anthony Eden writes:
I was so intrigued by having a proxy agent which would work for me that I wrote a little generic pluggable proxy this morning.
Show us the code! :) I want to play.
As for my code so far: This is extremely premature, and I'm not even sure if it will work anywhere besides my peculiar iBook, but here's a quick & dirty tarball of my experiments with a PersonalWebProxy (just web, not universal) with a simple plugin API, in Python using Twisted:
It's poorly commented, doesn't do much useful, but it's a few nights' work by someone just getting acquainted with Twisted - if you're even worse off than me and want to poke at this proxy thing, maybe this will help you. It does do a few things I thought were nifty, like use Mark Pilgrim's rssfinder script in a thread to dig up RSS feeds for every URL with text/html content you visit. There's no persistence yet, so they just appear in the log, but figuring out the integration and thread use so far was nifty to me.
Anyway, enjoy. I'm still tinkering, thinking, and working up a plan.
Oh yeah, and I'm watching Dick Clark and the ball drop with my girlfriend, so this post brings an end to hacking for the night.
shortname=ooocgo
Archived Comments
When it starts i get: [003382 INFO Unknown module] Proxy coming up on port 8813. Enabling Multithreading. dbproxy.proxy.ProxyFactory starting on 8813
I added a Service instance which stores the links harvested by RSSFinder in a dictionary, and I wrote a web interface that starts a server on 8080 and serves a woven page that displays the dictionary along with all the links. Piece of cake. EXCITING
I'll email you my code.