ripdad Posted January 1, 2014 Share Posted January 1, 2014 (edited) Most of this code is from an similar project posted here. The difference is that this one uses 100% TCP. It is also just a skeleton of what it could achieve - and not limited like the other one was. So, what is meant by "Passive"? Unlike the other code... As the proxy receives data from the web server, it will immediately forward it to the browser. So, when you download a file, you will see it in real time from the browser, along with whatever progress dialog it may have. I consider this script a good start at what I'd like to see it become eventually -- If and when I find the time to work on it. Please let me know if any crashes, bugs or quirks. Thanks! Updated: August 31, 2014 - Various improvements. Known issues: - Some TCP functions do not work correctly in 64bit. I have not tried to track that down yet. - HTTPS is not supported yet. _TCP_PassiveProxyFilter_v0.3b.au3 Edited September 1, 2014 by ripdad Celtic88 1 "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
ripdad Posted January 15, 2014 Author Share Posted January 15, 2014 (edited) Updated 1st post to v0.2b --- Now that I have some time, let's talk a little about this script. It is your browser that makes the request to a web server based on the source code of web documents (ie: html, js, css, etc.). There are plug-ins that allow "some control" over the content, but not "total control". A firewall is good, but they don't handle traffic content. You still need a firewall - even if it's Windows Firewall. At first, I tried to find a way to intercept web traffic by various means, but nothing seemed to work the way I wanted. In the end, the only way to get "total control" is with a local proxy. --- Three main points: 1) This is a single socket script; one for the browser and one for the remote server. There is no point in attempting true multiple socket transfers, because AutoIt is not multi-threaded. As a result, it will be slower loading a web page -- from your browsers point of view. 2) And so, I consider this program good for "Light to Medium" browsing. 3) I came to the conclusion, that it's best that the browser handle secure connections. As a result, This Script does not support secure connections. --- I took the script for a test ride on 'tube to see how it performs with streaming, and it did well (for me), with no problems. I downloaded a 56Mb file at about 650kb/s. Not bad for a single socket script. I have not tested it for sites that hosts java/flash games, etc. --- Okay, lets talk about some particular things of operation. Most likely, the first time you run this script, Windows Firewall will pop up and ask permission to allow this program to get access. This is normal - just click yes. The GUI appears afterwards and you'll notice that "AutoProxy" is unchecked. This is a feature that is in Firefox and Internet Explorer that uses "system settings" found in the registry. In order to use this script, you must configure your browser to use a proxy. Most are located under Tools->Options->Network (or something like that). I don't know about other browsers, but in Firefox, under the "Connection Settings" dialog, there is a setting called: "Use system proxy settings". It is usually set there by default. If you leave it there and place a checkmark in "AutoProxy", then you are good to go! For manual entry, on that same dialog, it's called: "Manual proxy configuration". The IP and Port are located at the top of this programs title bar. Type the IP number in "HTTP proxy" and the Port number in "Port". Click ok and that should do it. Keep in mind that, if you go the manual entry method, the proxy must be running when browsing. If the proxy is not running, the browser will show a connection error. If you go with the "AutoProxy" method, the browser will work as expected when both are running. Without the proxy running or "AutoProxy" is unchecked, the browser will work in its normal mode of operation, as if there was no proxy. Of the two methods, manual entry is the most secure. As a note, you can set the behavior of "AutoProxy" to default as "checked" near the top of the script. ie: Local $AutoProxy = 1 In addition, I added code to save the original settings of the registry when that feature is used. When this program closes, it will restore those settings. --- Let's move on to the Blacklist and Whitelist features. The only reason I added a Blacklist to this script, is because even if you have a site whitelisted, there are some things you don't want from that same site. The List's are not strict. You can add a partial string and it will detect on that. ie: ad-serve or ad-serve.com or www.ad-serve.com Any one of those should work. Most major sites have resource or image servers in addition to their own servers. I suppose these days, most are using Cloud servers in one way or another. Some sites have no resource server; the site server handles all of it. Some sites have one resource server and others might have as many as a dozen of them. So, in order to get "The Full Browsing Experience" of a site, you will also need to add their resource servers. You'll be able to know who they are by viewing the edit window of the GUI when browsing to a site. For example, you whitelisted wwww.somesite.com and went to it in your browser. You might notice in the edit window of the GUI several entries that read something like this: Unlisted: www.i1img-cdn.com Unlisted: www.i7img-cdn.com It's a safe bet that those are resource servers for the site you whitelisted. If you can, add the partial string and it will catch them all. ie: img-cdn.com If you can't, then you'll have to add each one on their own line. Sometimes, when reading a topic in a forum, the member will post an image from an outside source. For instance: www.photobucket.com If you really want to see that image - then you'll have to whitelist that outside source -- either temporarily or permanently. --- Known Bugs or Quirks 1) Sometimes, the browser will reset. I haven't been able to track that down yet, as it doesn't happen often enough. 2) A TCPConnect timeout can last up to 20 seconds while freezing the GUI, if a site is not responding. I am currently looking for something that will replace it, in this particular code. So far, all it does is cause more problems if I try some existing code that deals with timeouts. --- A few more things... I wrote this script in UltraEdit32, using AutoIt v3.3.6.0, and then checked against v3.3.8.1 and v3.3.10.2, on WinXP Pro SP2. So, it should be compatible across those versions of AutoIt. I tested this script using FireFox and nothing else. I don't have the time nor the will to make it compatible for all browsers, if it is indeed needed. I have not done any extensive testing on Vista+. TODO: the upload code - to properly handle files larger than 100kb. Edited January 15, 2014 by ripdad "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
ripdad Posted September 1, 2014 Author Share Posted September 1, 2014 I had a chance to work on this recently -- so here is an update, such as it is. 1st post updated to v0.3b "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now