What lies between my browser and the internet?
April 2, 2008 10:11 PM   Subscribe

I have an idea for a simple piece of software. It would involve intercepting browser requests, checking the requested url (probably not ip address, so before that conversion takes place) testing the url and redirecting if it passes the test. The test will itself make a network connection.

Probably a pretty simple problem, but my background is in web development, and I'm foggy about 'OS' stuff, if that's even what it's called.

How are some ways I can go about this? I'd ideally like to write the program in Java or Python, but I'm not really looking for code specific information. I'm looking for google terms, useful libraries, descriptions of what happens step by step between the time I press enter on the keyboard and the time the request leaves the computer, generally strategies.

I'm guessing it might be hard because this is what a lot of spyware does, but I would be happy even if installation required some configuration.
posted by miniape to Computers & Internet (11 answers total)
 
You could write a proxy server, and manually configure the browser to use it. There are some good existing java proxy systems that could get you started.
posted by comwiz at 10:15 PM on April 2, 2008


Perhaps a Firefox plugin?

Without being more specific about the application, it's hard to recommend a language or platform.
posted by Operation Afterglow at 10:16 PM on April 2, 2008


well, a browser plug in or proxy server would be the easiest ways to do this.

How exactly do you want to distribute this? Do you want to make a simple download for people? If so, then I'd go with a browser plug in for firefox. If you just need something for your own machine, it might be easier (for you as a web guy) to setup apache to act as a proxy, then write your re-directing thing in PHP.
posted by delmoi at 10:31 PM on April 2, 2008




Privoxy already does just this, and is quite customizable and scriptable. Why reinvent the wheel?
posted by ikkyu2 at 10:49 PM on April 2, 2008


Sorry, miniape, someone already made a Rick Roll detector. It's a Firefox plugin.
posted by rafter at 11:17 PM on April 2, 2008


Ha, it's not a Rick Roll detector, but that looks handy. Good Ideas. I'll look at those Proxy servers. They look like they might do what I need.
posted by miniape at 4:34 AM on April 3, 2008


Oh, as for how I want to distribute it? My first choice would be for a single .py file that would use only standard libraries making it easy to install on Mac and Linux and easy enough on Windows.

I already have apache, so I may give that shot. Firefox extension might be viable too.
posted by miniape at 4:49 AM on April 3, 2008


Burp is another (java-based) proxy which is run locally. IIRC it ships as one, albeit non-.py file, but really needs a config file to be useful.
posted by so at 5:45 AM on April 3, 2008


Twisted for Python seems to be the new hotness in simple network programming, an HTTP proxy should be bordering on trivial in it. Of course you'll need to reconfigure your browser(s) to use the proxy, so that complicates setup.

If you want to get really clever, take a look at transparent proxying with linux. I don't know the first thing about windows firewall programming but there might be a similar technique that's reasonably easily coded.
posted by Skorgu at 6:05 AM on April 3, 2008


one of these? Perl based in this case.
posted by singingfish at 6:11 AM on April 3, 2008


« Older Job hunting from overseas: good or bad idea?   |   logic board replacement success Newer »
This thread is closed to new comments.