Post Reply 
Another Filtering Proxy
Jun. 05, 2015, 12:26 PM (This post was last modified: Jun. 05, 2015 12:42 PM by cattleyavns.)
Post: #21
RE: Another Filtering Proxy
(Jun. 03, 2015 07:56 AM)whenever Wrote:  Well, you found an old bug, well done!

We don't need it. We can safely remove that line.

Well, I think we will need daemon, without daemon we cannot "Ctrl + C" to exit AFProxy, I feel a little bit uncomfortable when using "X" button to exit instead, and without Daemon we miss "OnExit"'s event using "atexit" module (import atexit).

Do you have any idea how to make thread.daemon = True or thread.setDaemon(True) work ? I tried to recover this feature but all I got is AFProxy stop working.

(Jun. 03, 2015 07:56 AM)whenever Wrote:  In version 0.4, what you change via req.headers in URLFilter.py will be copied to headers via below lines in AFProxy.py. I don't think you need to do extra work.

Code:
headers = urllib3._collections.HTTPHeaderDict()
[headers.add(key, value) for (key, value) in self.headers.items()]


I found another bug, we should move
Code:
        ########## Apply HeaderFilterOut ##########
        if config.HeaderFilter:
            if self.applyFilters('HeaderFilter', 'Out') == 'GetOut':
                return

Right above "headers = urllib3._collections.HTTPHeaderDict()" in your quote above, otherwise we cannot change/add/remove headers.

(Jun. 03, 2015 07:56 AM)whenever Wrote:  Thanks, but I want AFProxy to focus on filtering. You are free to make a new proxy based on AFProxy with whatever new features you like. Smile!

Great, thank you for that offer Wink

Here is my patch for AFProxy to make AFProxy work partially with socks proxy using Urllib(2) (weird, my implement look horrible, but for me better than nothing, right ?), based on version 0.4 because it is stable.

Need another module:
Code:
pip install pySocks

My implement way had my implement way problem, for example:
Code:
http://prxbx.com
-> TLSv1 ERROR
http://ghacks.net
-> Redirect forever error 30x

You might install BitviseSSHClient or AdvOr and set listen port to 10080 or change the line with "10080" with your socks proxy.

Changelog:
Code:
- Added socks support
- Moved:
        ########## Apply HeaderFilterOut ##########
        if config.HeaderFilter:
            if self.applyFilters('HeaderFilter', 'Out') == 'GetOut':
                return

right after URLFilter.

Test: http://ghacks.net/ip/


Attached File(s)
.zip  AFProxy.zip (Size: 5.26 KB / Downloads: 677)
Add Thank You Quote this message in a reply
Post Reply 


Messages In This Thread
Another Filtering Proxy - whenever - Nov. 22, 2014, 09:35 AM
RE: Another Filtering Proxy - whenever - Nov. 29, 2014, 11:24 AM
RE: Another Filtering Proxy - GunGunGun - Nov. 29, 2014, 02:15 PM
RE: Another Filtering Proxy - whenever - Nov. 30, 2014, 12:35 PM
RE: Another Filtering Proxy - GunGunGun - Dec. 03, 2014, 09:07 PM
RE: Another Filtering Proxy - whenever - Dec. 04, 2014, 01:09 AM
RE: Another Filtering Proxy - GunGunGun - Dec. 04, 2014, 02:33 AM
RE: Another Filtering Proxy - GunGunGun - Dec. 04, 2014, 03:27 PM
RE: Another Filtering Proxy - whenever - Dec. 05, 2014, 08:36 AM
RE: Another Filtering Proxy - GunGunGun - Dec. 05, 2014, 09:05 AM
RE: Another Filtering Proxy - whenever - Dec. 08, 2014, 03:30 AM
RE: Another Filtering Proxy - GunGunGun - Dec. 08, 2014, 09:09 AM
RE: Another Filtering Proxy - whenever - Dec. 08, 2014, 12:11 PM
RE: Another Filtering Proxy - whenever - Dec. 28, 2014, 10:50 AM
RE: Another Filtering Proxy - cattleyavns - May. 26, 2015, 06:22 AM
RE: Another Filtering Proxy - whenever - May. 27, 2015, 02:26 PM
RE: Another Filtering Proxy - cattleyavns - May. 28, 2015, 04:26 AM
RE: Another Filtering Proxy - whenever - May. 28, 2015, 09:53 AM
RE: Another Filtering Proxy - cattleyavns - May. 29, 2015, 04:07 AM
RE: Another Filtering Proxy - whenever - Jun. 03, 2015, 07:56 AM
RE: Another Filtering Proxy - cattleyavns - Jun. 05, 2015 12:26 PM
RE: Another Filtering Proxy - whenever - Jul. 19, 2015, 07:32 AM
RE: Another Filtering Proxy - cattleyavns - Jul. 19, 2015, 05:53 PM
RE: Another Filtering Proxy - cattleyavns - Jun. 17, 2015, 09:14 AM
RE: Another Filtering Proxy - cattleyavns - Jul. 01, 2015, 08:55 AM
RE: Another Filtering Proxy - whenever - Jul. 20, 2015, 03:31 AM
RE: Another Filtering Proxy - cattleyavns - Jul. 20, 2015, 06:17 AM
RE: Another Filtering Proxy - cattleyavns - Jan. 05, 2016, 04:53 PM
RE: Another Filtering Proxy - whenever - Jan. 06, 2016, 08:44 AM
RE: Another Filtering Proxy - cattleyavns - Jan. 06, 2016, 07:40 PM
RE: Another Filtering Proxy - whenever - Jan. 07, 2016, 02:25 AM
RE: Another Filtering Proxy - cattleyavns - Jan. 07, 2016, 08:41 AM
RE: Another Filtering Proxy - cattleyavns - Jan. 10, 2016, 07:27 AM
RE: Another Filtering Proxy - cattleyavns - Jan. 25, 2016, 04:37 PM
RE: Another Filtering Proxy - whenever - May. 16, 2016, 08:42 AM

Forum Jump: