home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch      Fun with MS-DOS batch files      42,547 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 42,470 of 42,547   
   Marion to All   
   Tutorial: Windows batch scripts to synch   
   02 Sep 25 04:10:51   
   
   From: marion@facts.com   
      
   Tutorial: Windows batch scripts to synchronize proxies & allow pass thru   
      
   MY OPINION:   
    a. Windows sucks on proxies.   
    b. Firefox sucks on proxies.   
    c. Chromium sucks on proxies.   
      
   UPDATE:   
      
   To be clear, I never touched this stuff until Epic Privacy Browser died on   
   me in early July so all this is completely new to me for building a socks5   
   proxy that is FAST and FREE and requires no registration (for privacy).   
    A. The beauty of socks5 is it's fast.   
    B. The beauty of VPN is it's complete.   
      
   There's no reason you can'd to both.   
    1. First run socks5 and then VPN, or,   
    2. F\irst run VPN and then socks5.   
      
   Ask me how I know that it works. :)   
      
   Anyway, I spent all day cleaning up the flow, so I decided to post my   
   latest update (as of today - which is how I spent my vacation) below.   
      
   I hope this helps others, although it's complicated stuff only   
   because Windows, Mozilla & Chromium can't get their act together.   
      
   Plus, Google, Amazon & Microsoft pissed all over my proxy setup.   
   (They hate us having privacy it seems.)   
      
   If only Windows didn't suck so bad with proxies this would be easier.   
   And if only Mozilla & Chromium didn't suck so bad with proxies too.   
      
   Sigh.   
   All this work is because Mozilla & Chromium & Windows sucks for proxies.   
      
   Anyway, I'm ready for bed so here's my log file update for today's work.   
       
       
    Name: psiphon3.exe   
    Size: 10402576 bytes (10158 KiB)   
    SHA256: DB1BAF76F0333F4743919A86F35037559F9E7DA7DF14982DFC16FB8DC0BE6BE2   
      
   Install location C:\apps\network\proxy\{psiphon,sockscap,freecap}\   
   Software archives C:\software\network\proxy\{psiphon,sockscap,freecap}\   
   Pullout menu C:\menus\network\proxy\{psiphon,sockscap,freecap}\   
      
   Once you run psiphon3 free socks proxy, you start thinking of all the ways   
   Windows sucks at proxies, and then you try to fix each of those ways.   
      
   Sigh.   
      
   Below is what took me all day today to build a modular proxy control system   
   that handles all three Windows proxy layers: WinINET, WinHTTP, and   
   PAC/AutoDetect. It launches Psiphon, waits for proxy ports to initialize,   
   and then runs pac.cmd to sync everything.   
      
   Because they hate encryption, the PAC file bypasses Gmail, Amazon, &   
   Copilot domains, while routing all other traffic through Psiphon's SOCKS   
   proxy.   
      
   These scripts support diagnostic modes, silent execution, & full reset   
   functionality. Since I love the Windows "App Paths" registry key, I've also   
   optionally integrated App Paths for seamless Win+R launching, and included   
   clear usage instructions, versioning, and logging.   
      
   It might not be perfect, but I designed it to be portable, maintainable, &   
   extensible. I'm sure there is more to do, but I'm done for today.   
   ================================================================   
   Step 1: Launch Psiphon   
   Step 2: Wait for proxy ports to initialize   
   Step 3: It will then run pac.cmd to sync WinHTTP & apply PAC   
   Optionally run proxy.cmd for diagnostics & configuration   
   ================================================================   
   To run "proxy.cmd" using the Windows taskbar-pinned "Win+R" RunBox:   
    Runbox > pac   
    Which calls the named App Paths key   
    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\pac.exe   
    Default=C:\data\sys\apppath\link\pac.lnk   
      
    Rightclick C:\data\sys\apppath\link\pac.lnk > Properties   
    TARGET=C:\Windows\System32\cmd.exe /c "C:\data\sys\batch\pac.cmd"   
   ================================================================   
   To run "pac.cmd" using the Windows taskbar-pinned "Win+R" RunBox:   
    Runbox > pac   
    Which calls the named App Paths key   
    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\pac.exe   
    Default=C:\data\sys\apppath\link\pac.lnk   
      
    Rightclick C:\data\sys\apppath\link\pac.lnk > Properties   
    TARGET=C:\Windows\System32\cmd.exe /c "C:\data\sys\batch\pac.cmd"   
   ================================================================   
   psiphon3.lnk   
   TARGET=C:\data\sys\batch\psiphon-launch.cmd   
      
   Win+R > gvim C:\data\sys\batch\psiphon-launch.cmd   
      
   @echo off   
   REM psiphon-launch.cmd v1.1 ¡X 20250901   
   REM Launch psiphon3.exe freeware & apply 3-way proxy sync/PAC   
   REM C:\data\sys\batch\psiphon-launch.cmd   
   REM Step 1: Launch Psiphon (which only syncs 1 of 3 Windows proxy types)   
   REM Step 2: Wait for proxy ports to initialize   
   REM Step 3: Run PAC setup (sync + PAC logic)   
   REM Note there are 3 different Windows proxy types. Sigh.   
   REM Type 1: WinINET ¡X used by IE, Edge (legacy), MS Office & most apps   
   REM Type 2: WinHTTP ¡X used by system services like Windows Update   
   REM Type 3: PAC/AutoDetect ¡X used by browsers like Chrome, Edge, & Firefox   
   REM (but Mozilla browsers have to be set first to respect system proxies).   
      
   if not exist "C:\app\network\psiphon\psiphon3.exe" (   
       echo ERROR: Psiphon executable not found.   
       exit /b   
   )   
      
   start "" "C:\app\network\psiphon\psiphon3.exe"   
      
   REM Wait a few seconds for Psiphon to initialize   
   timeout /t 5 /nobreak >nul   
      
   if not exist "C:\data\sys\batch\pac.cmd" (   
       echo ERROR: pac.cmd not found.   
       exit /b   
   )   
      
   REM Run PAC setup silently   
   start "" "C:\data\sys\batch\pac.cmd" /silent   
      
   ================================================================   
   Win+R > gvim C:\data\sys\batch\proxy.pac   
      
   /* proxy.pac v1.0 ¡X 20250901   
      Bypasses proxy for:   
      - *.google.com, *.gmail.com, *.amazon.com   
      - *.copilot.microsoft.com   
      All other traffic routed through SOCKS proxy at 127.0.0.1:1080   
   */   
      
   function FindProxyForURL(url, host) {   
     // Bypass Gmail and Google services   
     if (shExpMatch(host, "*.google.com") ||   
         shExpMatch(host, "*.gmail.com") ||   
         shExpMatch(host, "mail.google.com")) {   
       return "DIRECT";   
     }   
      
     // Bypass Amazon   
     if (shExpMatch(host, "*.amazon.com") ||   
         shExpMatch(host, "amazon.com")) {   
       return "DIRECT";   
     }   
      
     // Bypass Microsoft Copilot-related domains   
     if (shExpMatch(host, "*.copilot.microsoft.com") ||   
         shExpMatch(host, "*.bing.com") ||   
         shExpMatch(host, "*.microsoft.com")) {   
       return "DIRECT";   
     }   
      
     // Everything else goes through Psiphon SOCKS proxy   
     return "SOCKS 127.0.0.1:1080";   
   }   
      
   ================================================================   
   Win+R > gvim C:\data\sys\batch\pac.cmd   
      
   @echo off   
   REM pac.cmd v1.5 ¡X 20250901   
   REM Sync WinHTTP proxy & apply PAC logic for selective domain bypass   
   REM Used after Psiphon starts to align all three Windows proxy layers   
   REM ---------------------------------------------------------------   
   REM Step 1: Sync WinINET proxy into WinHTTP (used by system services)   
   REM Step 2: Apply PAC script & enable Auto-Detect (used by browsers)   
   REM ---------------------------------------------------------------   
   REM Usage:   
   REM  pac                   Sync WinHTTP & apply PAC   
   REM  pac /silent           Suppress final pause   
      
   [continued in next message]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca