Post Reply 
Force proxy for select sites
Apr. 10, 2011, 04:56 PM
Post: #1
Force proxy for select sites
Hi all. Having difficulties figuring out somethings re filters below.
Code:
[HTTP headers]
In = TRUE
Out = TRUE
Key = "!-|||||||||||||| Proxy: Force proxy select sites from autolist (Out) {sh8an}"
URL = "(^$TST(keyword=*.i_proxy:2.*))"
Match = "$URL(*$LST(ForceProxy)*)"
Replace = "$SET(keyword=i_proxy:2.)$JUMP(\u)"

In = TRUE
Out = FALSE
Key = "Location: 5 Route redirects through proxy (In) {sh8an}"
URL = "(^$TST(keyword=(*.|)i_proxy:2.(|*)))"
Match = "*redirected.com/"
Replace = "$JUMP(\u?prx-keyword=.i_proxy:2.)$ADDLST(ForceProxy,\h/\t\t\t\t##something)$LOG(RADD: \h to list)"

1. Force proxy
having problems with keyword. when i do just $SET(keyword=i_proxy:2.) proxy is not activated, with a jump i end up in a loop.
2. Autofill redirect list filter
What is the easy way of getting the TLD from \h? the way it is right now http://www.somesite.com/ gets inserted. i would like to have it ([^/]++.|)somesite.com/

The overall logic is as follows. there is a transparent proxy down the line which redirects with 302 on some specific sites. when this happens i want proxo to spot the redirect, add the TLD of the denied site to ForceProxy list (in order to use external proxy straight away in the future), and jump to URL using proxy.
would appreciate any suggestions.
Add Thank You Quote this message in a reply
Apr. 10, 2011, 06:05 PM (This post was last modified: Apr. 10, 2011 07:03 PM by JJoe.)
Post: #2
RE: Force proxy for select sites
(Apr. 10, 2011 04:56 PM)sh8an Wrote:  1. Force proxy
having problems with keyword. when i do just $SET(keyword=i_proxy:2.) proxy is not activated, with a jump i end up in a loop.

IIRC, a $JUMP() starts a new connection and thus clears all variables. So the "$SET(keyword=i_proxy:2.)" in your filter's replace can't do anything.

(Apr. 10, 2011 04:56 PM)sh8an Wrote:  2. Autofill redirect list filter
What is the easy way of getting the TLD from \h? the way it is right now http://www.somesite.com/ gets inserted. i would like to have it ([^/]++.|)somesite.com/

Not easy to always be correct but sidki does provide the "uDom" variable, http://sidki.proxfilter.net/prox/sidki-e...l_Vars.txt .

Quote:uDom Domain (e.g. domain.com or domain.co.uk)

(Apr. 10, 2011 04:56 PM)sh8an Wrote:  The overall logic is as follows. there is a transparent proxy down the line which redirects with 302 on some specific sites. when this happens i want proxo to spot the redirect, add the TLD of the denied site to ForceProxy list (in order to use external proxy straight away in the future), and jump to URL using proxy.
would appreciate any suggestions.

Hmmm...
1. Catch the redirect with header filter, add the URL match AND the i_proxy:2 command to to ForceProxy. Probably like (I'm not sure what needs to be escaped)

Code:
$ADDLST(ForceProxy, \([^/]++.|\)\1 \& \$SET\(keyword=\$GET\(keyword\).i_proxy:2.\))

and then $JUMP()
2. Catch the request with header filter, call ForceProxy. $JUMP() not needed here.

Not tested

Edit: somesite.com/ to \1
Edit: spelling and clarity, I hope.
Add Thank You Quote this message in a reply
Apr. 11, 2011, 06:12 AM
Post: #3
RE: Force proxy for select sites
(Apr. 10, 2011 06:05 PM)JJoe Wrote:  Not easy to always be correct but sidki does provide the "uDom" variable...
thanks. totally missed that one. weird! got concentrated on uHost only
Code:
[HTTP headers]
In = TRUE
Out = FALSE
Key = "Location: 5 Route redirects through proxy 0 (In) {sh8an}"
URL = "(^$TST(keyword=*.i_proxy:2.*))(^$URL($LST(*ForceProxy*)))"
Match = "*redirected.com/$ADDLST(ForceProxy,\(\[\^/\]\+\+.\|\)$GET(uDom)/\t\t\t\t\$SET\(keyword=i_proxy:2.\))$LOG(RADD: \(\[\^/\]\+\+.\|\)$GET(uDom)/ to list)"
Replace = "$JUMP(\u)"
so this one is fine and inserts as follows
Code:
([^/]++.|)denied.org/        $SET(keyword=i_proxy:2.)

(Apr. 10, 2011 06:05 PM)JJoe Wrote:  2. Catch the request with header filter, call ForceProxy. $JUMP() not needed here.
this one i still can not get.
Code:
[HTTP headers]
In = FALSE
Out = TRUE
Key = "!-|||||||||||||| 3 Proxy: Force proxy select sites from autolist (Out) {sh8an}"
URL = "(^$TST(keyword=*.i_proxy:2.*))$LST(ForceProxy)"
doesn't seem to do the trick. looks like the list and its contents (keyword) is not initialized.
Add Thank You Quote this message in a reply
Apr. 12, 2011, 02:56 AM
Post: #4
RE: Force proxy for select sites
First open the cfg in notepad and make sure the header filter's order is as expected. They need to be listed as shown in the Proxomitron's dialog.

To get the proper order I: exit the Proxomitron, restart, click "Config" on, "OK", and save the config.

(Apr. 11, 2011 06:12 AM)sh8an Wrote:  
Code:
[HTTP headers]
In = TRUE
Out = FALSE
Key = "Location: 5 Route redirects through proxy 0 (In) {sh8an}"
URL = "(^$TST(keyword=*.i_proxy:2.*))(^$URL($LST(*ForceProxy*)))"
Match = "*redirected.com/$ADDLST(ForceProxy,\(\[\^/\]\+\+.\|\)$GET(uDom)/\t\t\t\t\$SET\(keyword=i_proxy:2.\))$LOG(RADD: \(\[\^/\]\+\+.\|\)$GET(uDom)/ to list)"
Replace = "$JUMP(\u)"
so this one is fine and inserts as follows
Code:
([^/]++.|)denied.org/        $SET(keyword=i_proxy:2.)

"(^$URL($LST(*ForceProxy*)))" ?? I don't think that does anything? The $LST argument doesn't allow wildcards.
If $URL(*$LST(ForceProxy)), it is probably not the best way. $URL is slow. "*$LST(ForceProxy)" would cause the list to be called after every character of the url.
"$SET(keyword=i_proxy:2.)" will cause the current keyword to be lost or be overwritten, depending on filter order.

(Apr. 11, 2011 06:12 AM)sh8an Wrote:  this one i still can not get.
Code:
[HTTP headers]
In = FALSE
Out = TRUE
Key = "!-|||||||||||||| 3 Proxy: Force proxy select sites from autolist (Out) {sh8an}"
URL = "(^$TST(keyword=*.i_proxy:2.*))$LST(ForceProxy)"
doesn't seem to do the trick. looks like the list and its contents (keyword) is not initialized.

I think this is a filter order problem.
This filter needs to act before
"! |||||||||||| 3.4.a Use standard Proxy 07.05.31 [srl] (d.r) (Out)"
and
"Location: 5 Route redirects through proxy 0 (In) {sh8an}".
I think it needs another name.

Code:
[HTTP headers]
In = FALSE
Out = TRUE
Key = "! : 4  Proxy: Force proxy select sites from autolist (Out) {sh8an}"
URL = "(^$TST(keyword=*.i_proxy:2.*))$LST(ForceProxy)"

In = TRUE
Out = FALSE
Key = "Location: 5 Route redirects through proxy 0 (In) {sh8an}"
URL = "(^local.ptron/|$TST(keyword=*.i_proxy:2.*))"
Match = "$ADDLST(ForceProxy,\(\[\^/\]\+\+.\|\)$GET(uDom)\t\t\t\t\$SET\(keyword=\$GET\(keyword\)i_proxy:2.\))$LOG(RADD: \(\[\^/\]\+\+.\|\)$GET(uDom)/ to list)"
Replace = "$JUMP(\u)"

Worked for me at mail.yahoo.com but probably needs more work.

HTH
Add Thank You Quote this message in a reply
Apr. 12, 2011, 05:52 AM (This post was last modified: Apr. 12, 2011 06:26 AM by sh8an.)
Post: #5
RE: Force proxy for select sites
Thanks a lot! it's alive Smile!. in order to be make it look more like original and a bit more consistent with the design changed slightly
Code:
[HTTP headers]
In = FALSE
Out = TRUE
Key = "! * 4 Scan Additional User Lists - Append to Keywords (Out) {sh8an}"
URL = "(^$TST(keyword=*.s_ptron.*))$LST(ForceProxy)$SET(keyword=$GET(keyword)\0)"

In = TRUE
Out = FALSE
Key = "Location: 5 Route forced redirects through proxy (In) {sh8an}"
URL = "(^local.ptron/|$TST(keyword=*.i_proxy:2.*))"
Match = "*forced_redirect.com/$ADDLST(ForceProxy,\(\[\^/\]\+\+.\|\)$GET(uDom)/\t\t\t\t\$SET\(0=i_proxy:2.\))$LOG(RADD: \(\[\^/\]\+\+.\|\)$GET(uDom)/ to list)"
Replace = "$JUMP(\u)"

one could probably redo the second filter with checks for $RESP and $IHDR somewhere above, but it does the trick for me for now.
thanks again for help

Update:
In order to keep track of what's happening changed $LOG() to ($TST(volat=*.log:[12]*)$ADDLST(Log-Rare,HDR ForceProxy\tADD: \(\[\^/\]\+\+.\|\)$GET(uDom)/ \t\u)|)
Add Thank You Quote this message in a reply
Post Reply 


Forum Jump: