Monday, December 15, 2014

Hosts file and PAC filter on Windows 7

New Way Of Handling Hosts File On Windows 7

Somebody wrote to me saying that my hosts file installer is no longer suitable for Windows Vista, 2008 Server, Windows 7 or if you are crazy enough to use it there - Windows 8.

This is absolutely correct.  The UnxUtils way of using my hosts file on a Windows system is only for Windows XP and for use with something like Homer to act as a pseudo HTTP server (phttpd).  The reason I don't provide anything else is because I depend on somebody else's program to handle incorporating my hosts file on Windows 7 systems now.

If you use Windows 7, use Alex Kowalski's hosts file maintainance program which I provide download space for.  Here is the Hosts file page which shows where the links are:

Hosts File Page

Down at the end you see these two links:

APK's 64/32 Host File Engine Program
APK's 64/32 Host File Engine Instructions

My hosts file is primarily used by Linux people.  They use dnsmasq, Marco Peereboom's adsuck program or similar.  I am the only one using my phttpd.  But all of these people expect the hosts to be remapped to 127.0.0.1.  There is no 0.0.0.0 on Linux like there is on Windows.  On Windows 0.0.0.0 is normally used as an inter-process server.  On Linux and Unix they use a special file construct called pipes for processes to communicate with each other.

Will I remap the entries to something else other than 127.0.0.1?  No.  I depend on Alex Kowalski's program to do that for me.  The reason I mention this is because somebody wrote to me about this 4chan comment on hosts files (which you will note has Alex Kowalski's comment - APK):

4Chan comment on hosts files

What is my statement on using 0 versus 0.0.0.0?  I defer to Alex Kowalski on that issue since it is his APK 64/32 Hosts file engine that automatically does the conversion from 127.0.0.1 to what ever he uses.  Frankly I am surprised somebody wrote to me about it.  You can NOT use my shell file to install a hosts file on anything newer than Windows XP anyway.  Even if you give the script a temporary over-ride you have lots of programs like wget, rm, etcetera, the script calls that do not have the over-ride.  In fact you can no longer install UnxUtils on anything from Windows Vista on.  IOW, attempting to use my script file on Windows 7 will fail.  Even if you can seem to get it to work (I couldn't) use APK's Host File Engine Program instead.  His program does much more than just install a hosts file.  I will say you must use some other AV program on Windows 7 than the one provided by Microsoft with a hosts file.  The AV program supplied by Microsoft will remove every entry in a hosts file.  You must use another AV program to prevent Microsoft's AV program from removing hosts file entries.


New Way Of Handling PAC On Windows

*** WARNING:  ONLY PART OF THIS IS TESTED SO FAR!  I DO NOT KNOW IF HOMER OR ANY OTHER PSEUDO WEB-SERVER WILL RUN ON WINDOWS 7 YET! ***

Actually the only people I know using the PAC filter are all on Linux.  Most of the other people that look at my PAC filter don't actually use it.  They just look at my rules and stuff what they want into their company's proxy server.  That is fine with me because I used the most liberal GPL licensing enabling them to do that.

Here the special instructions for putting the PAC filter on Windows 7.  You don't put it on there the same way you do it on XP.  You should change it put all of the PAC filter files which can be used for Firefox in your account in an etc folder.  You also need an extra special folder for Internet Settings and it is mandatory for the Chrome browser.  For example for a user named hhhobbit and assuming your system drive is C: you will have these folders (substitute your user name for mine and it should be just alphabetic or alphanumeric characters):

C:\Users\hhhobbit\etc
C:\Users\hhhobbit\OneFile

You put all of the files you think you will need into the etc folder.  I have already tested changing the PAC filters altered so that blackhole goes to 0.0.0.0 and that does not work!  I have not done this part yet but will do it later on today (2015-08-01).

You put one and only one of the files proxy_en.txt or proxy_fr.txt into the OneFile folder.  This is because when you use Internet Settings, the Chrome browser parses every darn file in the folder.  So only one PAC filter file should be in that OneFile folder.  You would need to install Homer in roughly the same area, e.g.:

C:\Users\hhhobbit\Homer

I found out the hard way that FunkyToad croaked.  So I have revamped the Homer.zip file in such a way that it already has the allclear.gif file in it and that unzipping the Homer.zip file when it is plopped into C:\Users\hhhobbit\ folder you get the Homer folder automatically.  None of this mess files all over the place.


Okay,  What have I tested so far?  This string will work for me in Firefox 39 ( Firefox is the only browser left that can handle the debug) on Windows 7:

file://c:/Users/hhhobbit/etc/dbgproxy_fr.txt

To get it in you do a Tools, Options, set it to Advanced, select Network and then click the Settings button.  You then put in the string I just gave (substituting your user name for hhhobbit) in the "Automatic proxy configuration URL" box.  You select that by clicking the radio button next to it.  Remember all of this because until we get a pseudo web-server like Homer working on Windows 7 (I assume it won't work) you will be unchecking it real soon and going back to your default.  I forgot to record the default.  I will do it on my other system.

When I go to something like sexygirlz.org in the PAC filter with it set that way I get a proxy error message.  I tried changing the blackhole to 0.0.0.0 being careful to and then tried something like say sexygirlz.com (there is no way to clear the cache any more which is stupid in my opinion) it gives me the same proxy error message.

So today, 2015-08-01, I will be testing to see if Homer works.  If it does I will be back here filling in all the details and putting in the stuff for the other browsers.  Don't expect any of this to work for Windows 8 or Windows 10.  Either Windows XP or Windows 7 is the end of the road for the PAC filter on Windows.  Sorry.

HHH

No comments: