Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.comp.os.windows-10 > #187528

Re: Tutorial: Build a one-click Windows custom SOCKS5 proxy client using freeware

From Marion <marionf@fact.com>
Newsgroups alt.comp.os.windows-10, alt.comp.os.windows-11, alt.msdos.batch, alt.comp.software.thunderbird
Subject Re: Tutorial: Build a one-click Windows custom SOCKS5 proxy client using freeware
Followup-To alt.comp.os.windows-10, alt.comp.os.windows-11, alt.msdos.batch
Date 2025-09-18 10:51 +0000
Organization BWH Usenet Archive (https://usenet.blueworldhosting.com)
Message-ID <10ago7s$b82$1@nnrp.usenet.blueworldhosting.com> (permalink)
References (1 earlier) <10agdp4$ngs$1@nnrp.usenet.blueworldhosting.com> <10agf37$15ok$1@nnrp.usenet.blueworldhosting.com> <10aggsa$p1e$1@nnrp.usenet.blueworldhosting.com> <10agl6g$2od0$1@nnrp.usenet.blueworldhosting.com> <10aglru$fp9$1@nnrp.usenet.blueworldhosting.com>

Cross-posted to 4 groups.

Followups directed to: alt.comp.os.windows-10, alt.comp.os.windows-11, alt.msdos.batch

Show all headers | View raw


Marion wrote:
>   ==============================================
>     WINDOWS PROXY CONFIGURATION CHECK
>   ==============================================
>   PAC file found at C:\data\sys\batch\proxy.pac
>   SHA256 hash of C:\data\sys\batch\proxy.pac:

Ooops. I belatedly realized I had not posted the PAC file in the OP.
 From: Marion <marionf@fact.com>
 Newsgroups: alt.comp.os.windows-10,alt.comp.os.windows-11,alt.msdos.batch
 Subject: Tutorial: Build a one-click Windows custom SOCKS5 proxy 
          client using freeware
 Date: Thu, 18 Sep 2025 07:30:02 -0000 (UTC)
 Message-ID: <10agcdq$2e02$1@nnrp.usenet.blueworldhosting.com>
 <https://al.howardknight.net/?STYPE=msgid&MSGI=%3C10agcdq%242e02%241%40nnrp.usenet.blueworldhosting.com%3E>

The custom PAC file is optional, of course, but it allows you to bypass 
finicky domains, where I get tens of thousands of dollars of "free stuff" 
from Amazon Vine every year, so I don't want to piss the Vine Robots off
by changing IP addresses constantly on them (since you have to log in to 
get free stuff) <https://amazon.com/vine/about> and, of course, I use TB/BB
to log into Google Gmail servers where Google hates it when my IP changes
(it finally got used to my system time changing randomly as per scripting).

 /* 
    proxy.pac C:\data\sys\batch\proxy.pac (20250902)
    This is version 1.2
    Selectively bypass proxy for sites sensitive to tunneling or IP shifts:
    - Google services (search, news, mail, etc. but Thunderbird is stupid).
    - Amazon (especially the Amazon Vine Voice program)
    - Microsoft domains (Copilot, Bing, etc.)
    All other traffic routed through local SOCKS proxy at 127.0.0.1:1080
 
    Useful for split-tunnel setups where trusted domains go direct
    but everything else is encrypted via Psiphon SOCKS5 proxy.
 
    If needed, test PAC web access and fundamental logic with:
    - https://pactester.brdbnt.com/
    - https://github.com/termsl/WPADChecker
    - curl http://127.0.0.1/proxy.pac
 
    Version 1.0 (added Amazon Vine Voice https://amazon.com/vine/about)
    Version 1.1 (added Google Gmail but I need to add it to Thunderbird)
    Version 1.2 (added Microsoft sites for practice adding domains)
 */
 
 function FindProxyForURL(url, host) {
   // Bypass Gmail & Google (but Thunderbird needs to be set up right)
   if (shExpMatch(host, "*.google.com") ||
       shExpMatch(host, "*.gmail.com") ||
       shExpMatch(host, "mail.google.com")) {
     return "DIRECT";
   }
 
   // Bypass Amazon Vine https://amazon.com/vine/about
   if (shExpMatch(host, "*.amazon.com") ||
       shExpMatch(host, "amazon.com")) {
     return "DIRECT";
   }
 
   // Bypass Copilot & Microsoft domains for practice
   if (shExpMatch(host, "*.copilot.microsoft.com") ||
       shExpMatch(host, "*.bing.com") ||
       shExpMatch(host, "*.microsoft.com")) {
     return "DIRECT";
   }
 
   // All other traffic via SOCKS
   return "SOCKS 127.0.0.1:1080";
 }
 
In addition, you can NOT set up Thunderbird for SOCKS5 via Psiphon.
1. Thunderbird:
   Tools > Settings > Network & Disk Space > Connection > Settings...
2. In the Connection Settings dialog:
   a. Select "Manual proxy configuration"
   b. Under "SOCKS Host", enter: 127.0.0.1
   c. Port: 1080
   d. Choose "SOCKS v5"
3. Leave "HTTP Proxy", "SSL Proxy" & "FTP Proxy" blank.
4. Optionally check "Use proxy server for all protocols" if needed.
5. Click "OK" to save.

Why not?
A. Thunderbird does not use Windows proxy settings or PAC files.
B. You must configure proxy settings manually inside Thunderbird.
C. If Psiphon is not running, connections through 127.0.0.1:1080 will fail.
D. For automation, you can launch Thunderbird via a batch script
   that sets environment variables like:
    set SOCKS_PROXY=127.0.0.1:1080
    start thunderbird.exe
E. Which you can tie into an easy command in the system registry
   Win+R > tb
   Where tb is defined in the registry App Paths key as
   HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\tb.exe
   And where tb.exe is a keyword pointing to tb.lnk or tb.bat files.

Unfortunately, Thunderbird does not use PAC file logic, even if we 
configure it to use a SOCKS proxy. Sigh. They don't know how to code.

When we manually set Thunderbird to use 127.0.0.1:1080 as a SOCKS5 proxy, 
it sends all traffic through that proxy regardless of any of those special 
PAC rules defined in proxy.pac above.

Thunderbird does not support domain-based proxy exceptions
If I use "Manual proxy configuration" with SOCKS 127.0.0.1:1080, 
then all traffic goes through Psiphon but Google hates IP changes.
There is no built-in way in TB to exclude Gmail while proxying others.

PAC files are only interpreted by applications that support automatic proxy 
configuration via system settings (like most browsers). Unfortunately for 
us, Thunderbird does not read or apply PAC logic internally.

So even if my PAC file says to bypass Gmail and go direct, Thunderbird will 
still send Gmail traffic through the SOCKS proxy unless I manually exclude 
it or use a different method. 

The only way I know around Thunderbird's lack of proper coding is to make 
Thunderbird connect directly to Gmail (without routing through Psiphon).

To do that, I need to bypass the SOCKS proxy for Gmail-related domains. 
Since Thunderbird does not support PAC files or system proxy exceptions, we 
must do this manually (aurgh!). I hate doing anything manually. Sigh.

OPTION 1: Disable proxy in Thunderbird entirely
 a. Tools > Settings > Network & Disk Space > Connection > Settings...
 b. Select "No proxy"
 c. This sends all traffic directly, including Gmail

 Thunderbird does not support domain-based proxy exceptions
 If you use "Manual proxy configuration" with SOCKS 127.0.0.1:1080, 
 then all traffic goes through Psiphon
 There is no built-in way to exclude Gmail while proxying other traffic

OPTION 2: Launch Thunderbird with proxy environment variables. Yuck.
 a. Set environment variables before launching Thunderbird:
    set NO_PROXY=google.com,gmail.com
    set SOCKS_PROXY=127.0.0.1:1080
    start thunderbird.exe
Note: This may work for some protocols, but Thunderbird does not
fully honor NO_PROXY for IMAP/SMTP, so it's an ugly workaround.

While Betterbird is a fork of Thunderbird that focuses on usability 
improvements, bug fixes and faster feature delivery, unfortunately 
Betterbird uses the exact same sophomoric proxy engine as Thunderbird.

In short, TB/BB does not support smart split proxy logic like browsers do, 
so bypassing Gmail while using Psiphon requires trade-offs in our setup.
-- 
Note that a.c.s.t was added only for this one related post of the dozen.

Back to alt.comp.os.windows-10 | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Tutorial: Build a one-click Windows custom SOCKS5 proxy client using freeware Marion <marionf@fact.com> - 2025-09-18 07:30 +0000
  Re: Tutorial: Build a one-click Windows custom SOCKS5 proxy client using freeware Marion <marionf@fact.com> - 2025-09-18 07:53 +0000
    Re: Tutorial: Build a one-click Windows custom SOCKS5 proxy client using freeware Marion <marionf@fact.com> - 2025-09-18 08:15 +0000
      Re: Tutorial: Build a one-click Windows custom SOCKS5 proxy client using freeware Marion <marionf@fact.com> - 2025-09-18 08:46 +0000
        Re: Tutorial: Build a one-click Windows custom SOCKS5 proxy client using freeware Marion <marionf@fact.com> - 2025-09-18 09:59 +0000
          Re: Tutorial: Build a one-click Windows custom SOCKS5 proxy client using freeware Marion <marionf@fact.com> - 2025-09-18 10:11 +0000
            Re: Tutorial: Build a one-click Windows custom SOCKS5 proxy client using freeware Marion <marionf@fact.com> - 2025-09-18 10:51 +0000
              Re: Tutorial: Build a one-click Windows custom SOCKS5 proxy client using freeware Marion <marionf@fact.com> - 2025-09-18 11:09 +0000
                Re: Tutorial: Build a one-click Windows custom SOCKS5 proxy client using freeware Marion <marionf@fact.com> - 2025-09-18 11:53 +0000
                Re: Tutorial: Build a one-click Windows custom SOCKS5 proxy client using freeware "R.Wieser" <address@is.invalid> - 2025-09-18 15:06 +0200
                Re: Tutorial: Build a one-click Windows custom SOCKS5 proxy client using freeware Marion <marionf@fact.com> - 2025-09-19 00:42 +0000
                Re: Tutorial: Build a one-click Windows custom SOCKS5 proxy client using freeware Marion <marionf@fact.com> - 2025-09-21 04:34 +0000
                Re: Tutorial: Build a one-click Windows custom SOCKS5 proxy client using freeware Marion <marionf@fact.com> - 2025-09-22 20:31 +0000
                Re: Tutorial: Build a one-click Windows custom SOCKS5 proxy client using freeware Marion <marionf@fact.com> - 2025-09-22 20:41 +0000
                Re: Tutorial: Build a one-click Windows custom SOCKS5 proxy client using freeware Marion <marionf@fact.com> - 2025-09-23 17:22 +0000
                Re: Tutorial: Build a one-click Windows custom SOCKS5 proxy client using freeware Marion <marionf@fact.com> - 2025-09-28 06:10 +0000
                Re: Tutorial: Build a one-click Windows custom SOCKS5 proxy client using freeware Marion <marionf@fact.com> - 2025-10-17 05:40 +0000
                Re: Tutorial: Build a one-click Windows custom SOCKS5 proxy client using freeware Marion <marionf@fact.com> - 2025-10-17 05:44 +0000
                Re: Tutorial: Build a one-click Windows custom SOCKS5 proxy client using freeware Marion <mariond@facts.com> - 2025-10-29 11:55 -0600
                Re: Tutorial: Build a one-click Windows custom SOCKS5 proxy client using freeware Marion <mariond@facts.com> - 2025-10-29 11:58 -0600
                Re: Tutorial: Build a one-click Windows custom SOCKS5 proxy client using freeware Marion <mariond@facts.com> - 2025-10-30 00:56 -0600
                Re: Tutorial: Build a one-click Windows custom SOCKS5 proxy client using freeware Marion <mariond@facts.com> - 2025-11-02 20:45 -0700
                Re: Tutorial: Build a one-click Windows custom SOCKS5 proxy client using freeware Marion <mariond@facts.com> - 2025-11-02 20:58 -0700
                Re: Tutorial: Build a one-click Windows custom SOCKS5 proxy client using freeware Marion <mariond@facts.com> - 2025-11-03 10:41 -0700
                Re: Tutorial: Build a one-click Windows custom SOCKS5 proxy client using freeware Marian <marianjones@helpfulpeople.com> - 2025-12-01 15:38 -0700
                Re: Tutorial: Build a one-click Windows custom SOCKS5 proxy client using freeware Marian <marianjones@helpfulpeople.com> - 2025-12-02 01:11 -0700
  Re: Tutorial: Build a one-click Windows custom SOCKS5 proxy client using freeware Marian <marianjones@helpfulpeople.com> - 2025-12-02 09:19 -0700

csiph-web