users@grizzly.java.net

Grizzly-based proxy server

From: Peter Speck <speck_at_vitality.dk>
Date: Mon, 2 Jun 2008 16:56:59 +0200

On 23/05/2008, at 20:52, Jeanfrancois Arcand wrote:

> Peter Speck wrote:
>> On 23/05/2008, at 17:26, Jeanfrancois Arcand wrote:
>>> I see. A Grizzly based Proxy Server is something a lot of peoples
>>> are looking at. If one day you want (or your company want :-)) to
>>> OSS it, ping us as we will be really interested to have in under
>>> the Grizzly umbrella....(OK I'm acting like a marketing guy :-))
>>
>> No problem, however it is not a fully fledged proxy with bells and
>> whistles. It's just a banner-killer. I'm using Safari on the mac
>> and it doesn't support Firefox Greasemonkey or any other such
>> plugins, and I just can't stand flashing ads.
>> The functionality is to block ~40 domains and to modify html (or
>> inject javascript) for a few sites to enhance the "user
>> experience" (e.g. youtube download link).
>> All code is mine (owned by me, never released, and I don't have any
>> employer restrictions), so there's no license problem, but
>> everything is very raw and there is no configuration files -
>> everything is hardcoded in java.
>
> That can be a good startup still. What we can do it "incubate" your
> code and see if we can extends it, and comes with a roadmap to have
> it as a full fledged proxy. I guess the difficult part is to make
> sure it can be extended, e.g. we have a plugs in facility.


Here's the source. I've added javadocs and made it easier to write
custom filters.

The proxy only blocks or modifies content, it never caches content.

A simple build script is included as I'm not familiar with maven/ant
(I'm using IDEA). The source is straightforward to compile, but all
*.js files from the src directory should be added to the jar. It's
written using Grizzly 1.7.3.3.

I didn't know how to use Grizzly as an HTTP client, so for the time
being HttpUrlConnection is used. Have you any example code of client
usage?


----
  - Peter Speck
     The only time that animation is called for on a computer screen
     (aside from in the movies) is when your house is on fire.
         - Alan Cooper