Post Reply 
proxomitron clone in perl
May. 09, 2005, 07:20 AM
Post: #1
 
I decided to write a proxomitron clone, because I didn't really like the alternatives (I'm using linux, and proxomitron sometimes works with wine, and sometimes doesn't). My natural choice is perl, because I know it better than some other languages, and it's easy to do regex's. My natural OS is linux, but no doubt it will be ported one day.

As the name 'clone' says, I will try and make it act like the proxomitron, and be compatable with all its features. So far, I've pretty much got it working as a "transparent proxy", with a few hiccups.

But I have a few questions: is there any interest in such a thing? and has anyone done it before? I know there are other web filters, but I'm talking about one that is _very_ similar to the proxomitron, if not the same.

Well, I'd be interested to hear what anyone has to say - do's, don'ts, or don't care!

thanks,
Iain.
Add Thank You Quote this message in a reply
May. 09, 2005, 06:29 PM
Post: #2
 
Iain;

Hi, and Welcome to the forum!

As an old perl-man myself, I feel compelled to remind you that unless you can compile and link your source code into a machine language, then you're gonna have to require that your users install a run-time environment for your proggie. As I'm sure you are well aware, this is no easy task for the average Windows user. Power users, yes...... average users, no, not so easy. Which in turn means that your actual audience may end up being a mere subset of your intended greater market.

Just something to think about. Other than that, I'd say 'go for it'! [lol]

Cheers


Oddysey

I'm no longer in the rat race - the rats won't have me!
Add Thank You Quote this message in a reply
May. 10, 2005, 06:56 AM
Post: #3
 
Oddysey Wrote:Hi, and welcome to the forum!
Thanks!

Yes I did think about having to install perl, but my reasons for doing it this way were simply

1. I couldn't do it as fast in any "compiled" language
2. My audience is initally myself Smile! then linux users (who can't run proxomitron natively) so they probably already have perl or can get it easily.

I may indeed end up kicking myself in the future, but oh well!

And now for a status report:

So far the proxomitron clone reads a proxomitron config file (such as default.cfg) and works on simple request headers (so long as they don't use any of the block lists, etc). I tested it with the user-agent filters, and I'm actually using it to write this post Big Teeth

Well, I have my proof of concept, so I guess I'll keep going. I will definately be checking back in here to find out what the real behaviour of the proxomitron actually is! When I have the banner blaster working, then I'll be happy:

Code:
Name = "Banner Blaster (limit text)"
Active = TRUE
Multi = TRUE
Bounds = <a\s[^>]++href=*</a>|<input*>|<ilayer*</ilayer>|<iframe*</iframe>|<object*</object>"
Limit = 900
Match = "(<(ilayer|iframe|object)*|\1<i(mg|mage|nput)*src=$AV(*)*>\3)"
"&(*(href|src)=$AV($LST(AdKeys)*)|"
"*http://*<i(mg|mage|nput)\s(*>&&"
"(*width=[#460-480]&*height=[#55-60]*)|"
"(*width=[#88]&*height=[#31]*)))"
"&(*alt=$AV((?+{18})\2*|\2)|$SET(2=Ad))"
Replace = "<center>\1<font size=1 color=red>[\2]</font>\3</center>"

Just looking at it makes me go crosseyed...

R,
Iain.
Add Thank You Quote this message in a reply
May. 11, 2005, 04:03 AM
Post: #4
 
Iain;
Quote:Just looking at it makes me go crosseyed...
They make special glasses for that, y'outta check 'em out. [lol]

Today, the linux distros..... tomorrow, the world! Good planning. Big Teeth Do keep us updated. If it gets serious enough, we'll set up a forum area for you like we've done for kuruden and his Proxomodo project.

For all things deep in the bowels of Proxo, just ask sidki3003! Hail That's what the rest of us do, when we're stuck. [rolleyes]


Oddysey

I'm no longer in the rat race - the rats won't have me!
Add Thank You Quote this message in a reply
May. 13, 2005, 01:06 AM
Post: #5
 
This is a very cool idea and would be appreciated by many Linux users. I would migrate to Linux if Proxomitron was as solid as it is in Windows or if there was a clone for it. And now this gives me an opportunity to reconsider that move! Keep on it, Iain! And... WELCOME to this forum! Enjoy your stay!
Add Thank You Quote this message in a reply
May. 13, 2005, 01:49 AM
Post: #6
 
Seikatsu Wrote:This is a very cool idea...

Thanks, IMHO the lack of the proxomitron in linux is not enough to stop me using it! But at least now you have one coming.

Incidentally, I only discovered proximodo http://sourceforge.net/projects/proximodo/ after starting my proxomitron clone (anyone got a good suggestion for a name btw?). It looks like proximodo is very close to being released for linux... we'll see.

Oddysey Wrote:For all things deep in the bowels of Proxo, just ask sidki3003!

I do have a question about the internals of proxomitron, that I want to get right - The HTTP header help mentions:

Quote:1. To change a header: both the matching expression and replacement text must have something in them. Just use "*" in the matching clause to match all headers of that type.

2. To delete a header: include a matching expression, but leave the replacement text blank.

3. To always add a header: include a replacement text, but leave the matching expression blank.

4. To add a header only if it doesn't exist: include a replacement text, but use "(^?)" in the match. Looks odd? Well, it is! Since (^...) means NOT and ? means ANY character, (^?) translates into "not any character"!

1. and 2. make sense!

point 3. sounds like proxomitron adds the header even if it already exists, therefore ending up with two reqest headers of the same name being sent to the host... is this right?

point 4. makes sense, if it doesn't exist, add it. This is what I would imagine happens. So what is number 3.? It doesn't mean replace the header, because thats done by number 1...

I would appreciate some enlightenment on this from anyone, Thanks!

Now for some more updates: progress is going well (it seems to be too easy!) I will soon post a page on my website where you can check the status of what features I've implemented. When I've got a good chunk of the features (excluding the gui for now) I'll release it in some alpha form.

The gui will come later - I'm writing it so the gui can be done separately by another program. (Maybe someone wll want to help with this Wink ) but thats too far in the future to think about now...

Thanks for all the comments, keep em coming!

R,
Iain.
Add Thank You Quote this message in a reply
May. 13, 2005, 06:11 AM
Post: #7
 
Regarding header filters:

point 3:
If there already is such a header, replace the old field with the new one.
If not, add that header.

point 4:
If there already is such a header, don't do anything.
If not, add that header.

point 1 is the same as point 3, only if you use a plain asterix as matching expression. IOW, it does the same as an empty match here. So, usually you don't use just an asterix in the header match but test for something.


Good luck! Smile!
sidki
Add Thank You Quote this message in a reply
Post Reply 


Forum Jump: