Post Reply 
Problem with "\h"
Jul. 30, 2004, 03:43 PM
Post: #16
 
sidki3003 Wrote:
ProxRocks Wrote:Is that going to be included in the next release?
Yep Smile!
Cool!

Hmm, by chance, could you enlighten us in advance with the header filter that the file references?

I guess my curiosity is getting the better of me...
Add Thank You Quote this message in a reply
Jul. 30, 2004, 04:49 PM
Post: #17
 
z12;
Quote:Here's a thing I've noticed with header filters. If you have more than filter enabled for a particular header, which one gets called first can be unpredictable. I have seen where the displayed filters are not in the same order as they are in the config file. Proxo seems to sort by the name the filter has, so changing a name can change the calling order.
About a 18 months ago, perhaps a bit further back in time. Scott addressed this issue for a discussion on Arne's forum. Speaking from memory, Scott said that he has no control over the loading order of either the header or web filters. This is a direct result of the hashing algorithms used in parsing the file contents and storing the results in memory arrays. Naming conventions, filter textual length, order stored in the file, etc. - nothing the user can do will assert control over the order in which filters are loaded.

Scott always warned people to use Multi sparingly and wisely, for just this reason. I wasn't privy to all of the discussions that went on, but from what I gathered, he chose to exhort speed over filter order. Not having the source code in front of me, I can't say that he was right or wrong, or that he missed something that could have affected his decisions. What I can say is, I don't care what his reasons were, nor what the final results are, Proxo turned out just fine, IMNSHO. [lol] All Hail Scott! Smile!

I know this doesn't solve the problem, but there's no help for it. You'll just have to accept the fact that any two-filter solution is a wee bit shaky at best, and downright unworkable if Mr. Murphy should choose that particular moment to make you his b***h. :P Otherwise, I haven't the foggiest clue as to why the \h doesn't play nice with two-letter TLD's. Perhaps it's hard-wired into Proxo, we'll never know.


Oddysey

I'm no longer in the rat race - the rats won't have me!
Add Thank You Quote this message in a reply
Jul. 30, 2004, 06:45 PM
Post: #18
 
Hi Oddysey,

I agree, 2 or more filter solutions for headers is a bit shakey. Given that, I have had good luck using the numbering scheme.

I have noticed that when you edit you header filters & save the config, the order in which the filters are saved to the config always changes.

To help get around this, I use my numbering scheme where there are multiple filters for the same header.

After saving the config, I close proxo then reopen it & "Save Config File" as the same name, then close it again.

This puts the header filter order in the config file back the same way it was.

This has worked well for me and my multi-filter header filters that I use seem to work in the planned order. (crosses fingers).

Mike
Add Thank You Quote this message in a reply
Jul. 30, 2004, 06:48 PM
Post: #19
 
Hi, all

Here's the modified filters, finally.

Code:
[HTTP headers]
In = FALSE
Out = TRUE
Key = "Accept: 1. Default to all (out)"
Match = "\1"
Replace = "*/*$SET(dhost=\h)$TST(dhost=([0-9.]+)\9(^?)|(|*.)([^.]+.((com|net|edu|gov|org|mil|info|biz|??).??|[^.]+))\9(^?))$SET(dom=\9)"

[HTTP headers]
In = TRUE
Out = FALSE
Key = "Location: 2. Show HTML Redirects (in)"
Match = "$RESP(30*)$IHDR(Content-Type: text/(html|plain))(http://*)\1&(^([a-z]+://[^/]++.|)$TST(dom))"
Replace = "http://local.ptron/redir.html?dest=\1"

[HTTP headers]
In = FALSE
Out = TRUE
Key = "Referer: 1. Same Domain Only (Out)"
Match = "(^([a-z]+://[^/]++.|)$TST(dom))"

*******************
A couple of Notes:

The "accept" header filter includes sidki's code for getting the domain & host of the url. I added the "biz" domain, but after checking here, http://www.icann.org/tlds/ I'm wondering if maybe these other tlds should be included.

Also, I replace my "accept" header with "*/*, if you want to keep your orginal, modify the replacement text with \1 instead.

For the "referer" filter, I don't send one if the domain doesn't match. If you want to send one, add your favorite replacement text.

*******************

It seems to me that using sidki's code in the header, opens up some possibilities. One filter I'm thinking about is blocking any "set-cookie" if the domain doesn't match.

Thanks all
Mike
Add Thank You Quote this message in a reply
Jul. 30, 2004, 07:41 PM
Post: #20
 
Cool that it worked! Smile! It's just two months ago that i was literally suffering under that two level top domain thingie, until some kind soul (Sam Schinke) posted the rule that these sites follow - lol

z12 Wrote:I have noticed that when you edit you header filters & save the config, the order in which the filters are saved to the config always changes.
It swaps between two states (since v4.5). Numbering *does* help. This is *not* an issue with web filters - the wise use of "multi" as suggested by Scott is a diff thing.


sidki
Add Thank You Quote this message in a reply
Jul. 30, 2004, 07:49 PM
Post: #21
 
ProxRocks Wrote:Hmm, by chance, could you enlighten us in advance with the header filter that the file references?
As simple as it can get Big Teeth
Code:
[HTTP headers]
In = FALSE
Out = TRUE
Key = "!|||||||||||| 3 URL Splicer     4.05.26 [s th] (d.r) (Out)"
URL = "$LST(URL-Splicer)"
Add Thank You Quote this message in a reply
Jul. 30, 2004, 08:22 PM
Post: #22
 
z12 Wrote:I added the "biz" domain, but after checking here, http://www.icann.org/tlds/ I'm wondering if maybe these other tlds should be included.
I missed "biz" - added - thanks! "name" and "pro" are valid second level domains (eg. http://www.no.name.de/ ), hence problematic.
Add Thank You Quote this message in a reply
Jul. 30, 2004, 08:23 PM
Post: #23
 
lol... yep, that's simple all right...

suspect I'll wait until your next much-anticipated config release goes public...
then I can reverse-engineer the slicer's useage...


edit: I see big potential in this scheme for blocking off-site content and distinguishing from what is off-site versus "under-site" content...
Add Thank You Quote this message in a reply
Jul. 30, 2004, 10:33 PM
Post: #24
 
sidki;
Quote:It swaps between two states (since v4.5). Numbering *does* help. This is *not* an issue with web filters - the wise use of "multi" as suggested by Scott is a diff thing.
Sorry, I was unaware that Scott had overcome that hurdle, or that he was even working on it. I guess I must have skipped school that day. [sigh] To tell the truth, it never even dawned on me to re-try it under the latest version. Last time I even thought about it was when we are all still using Naoko 4.4 (possibly except for a few anointed beta testers <_< ).

Mike, in all things this technical, you should defer to sidki, and accept whatever he says as gospel. After all, they don't call him "The Filter Factory" for nothing!


Oddysey

I'm no longer in the rat race - the rats won't have me!
Add Thank You Quote this message in a reply
Jul. 30, 2004, 11:33 PM
Post: #25
 
Hi all

Yes, sidki is the man!

Here is an update to the referer filter, I had some misplaced parenthesis.

Code:
[HTTP headers]
In = FALSE
Out = TRUE
Key = "Referer: 1. Same Domain Only (Out)"
Match = "^(([a-z]+://)([^/]++.|)$TST(dom))"

The previous referer I posted had an issue here: http://nic.de.ki/

I don't know what the site is about, since I can't read german, but it had an interesting url (domain name wise). Big Teeth

Anyway, if anybody tries these and has problems, let me know.

Mike
Add Thank You Quote this message in a reply
Jul. 30, 2004, 11:56 PM
Post: #26
 
z12,
Your code (a few messages ago) works brilliantly. I appreciate the advice. My two filters (Fake and Hide) do work, but your code removes the need for two filters. This is my revised referer filter. It works with domains with 3-letter or 2-letter suffixes.
Code:
[HTTP headers]
In = FALSE
Out = TRUE
Key = "Referer: Hide previous host v2 (out)"
Match = "$SET(host=\h)(*|)(https+://)\0(^$TST(host)) "
Replace = "\0$GET(host)/"

Sidki,
Your explanation of how the \h works was very clear. I have learned something useful.
Add Thank You Quote this message in a reply
Jul. 31, 2004, 05:14 PM
Post: #27
 
Glad to hear!

Oddysey: Not gospel - just setting the record straight. I think we all don't want Proxomitron look less easy to handle than it is - hope you got that right. Smile!

sidki
Add Thank You Quote this message in a reply
Post Reply 


Forum Jump: