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


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

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
Subject Re: Tutorial: Build a one-click Windows custom SOCKS5 proxy client using freeware
Date 2025-09-18 08:15 +0000
Organization BWH Usenet Archive (https://usenet.blueworldhosting.com)
Message-ID <10agf37$15ok$1@nnrp.usenet.blueworldhosting.com> (permalink)
References <10agcdq$2e02$1@nnrp.usenet.blueworldhosting.com> <10agdp4$ngs$1@nnrp.usenet.blueworldhosting.com>

Cross-posted to 3 groups.

Show all headers | View raw


Marion wrote:
> Tutorial: 
> Build a one-click Windows custom SOCKS5 proxy client using freeware
> Note that I will post working companion scripts following this overview.

While companion blocks are listed below, some are optional.
1. proxy.cmd (posted)
   registry sync helper that reads and writes WinINet & WinHTTP settings
2. pac.cmd (to be posted)
   PAC file installer that calls proxy.cmd to enforce AutoConfigURL 
   and AutoDetect so that these three domains are bypassed 
   Amazon Vine (https://amazon.com/vine/about)
   Google Gmail (https://mail.google.com) 
   Microsoft (https://copilot.microsoft.com) 
   These are bypassed since they hate proxies like they hate VPN.
3. launchmongoose.vbs (posted below)
   Launches a lightweight HTTP server that serves proxy.pac to localhost
4. psiphon.bat (posted in the original post opening up this thread)
   The main proxy client which elevates to admin, starts mongoose, 
   launches Psiphon, applies PAC logic, syncs to WinHTTP & logs activity

In keeping with the idea that anything you do more than once on Windows 
should be tied to a single click, launchmongoose.vbs is an optional helper 
that silently starts the Mongoose web server in the correct working 
directory so it can host proxy.pac at http://127.0.0.1. It only launches if 
mongoose.exe is not already running and logs the result to mongoose.log.

Keep in mind that this custom proxy client works fine without Mongoose 
because Psiphon in SOCKS5 mode does not require a PAC file to be served 
over HTTP (that is, the PAC URL in the registry can point to a local file 
path or direct proxy settings as it doesn't need to be served over HTTP).

The benefit of adding the lightweight Mongoose web server was that mongoose 
is an easy way to serve the PAC file over HTTP before Psiphon starts. 

This allows:
 a. The PAC URL in WinINet and WinHTTP to point to a live file 
    at http://127.0.0.1/proxy.pac
 b. Any app or service that supports PAC files to fetch proxy 
    rules immediately without using an external server
 c. Custom bypass logic such as skipping Amazon Vine, Gmail
    and Microsoft Copilot to be applied system wide
 d. The PAC file to remain available even if Psiphon changes 
    network routes because the PAC file is hosted locally

In short, the launching of Mongoose turns my custom proxy client setup from 
just a SOCKS5 tunnel into a more-self-contained proxy service with dynamic 
routing rules, making PAC logic work reliably across all stacks & apps.

With that backround in mind, here's the OPTIONAL mongoose-launch script.
 ' ============================================
 ' launchmongoose.vbs 20250916 version 1.0
 ' This is version 1.5
 ' ============================================
 ' Version History:
 '   1.0 - 20250916 Initial silent launch
 '   1.1 - 20250916 Added process check and logging
 '   1.2 - 20250916 Fixed duplicate End If error
 '   1.3 - 20250916 Added version header block, cleaned structure
 '   1.4 - 20250916 Removed unconditional launch
 '                  Now launches only if not running
 '   1.5 - 20250916 Updated launch command to explicitly set working directory
 ' ============================================
 ' Serves C:\data\sys\batch\proxy.pac as http & https
 ' Launch using: cscript //nologo launchmongoose.vbs
 ' Test using: curl http://127.0.0.1/proxy.pac
 ' Testing using: type mongoose.log
 ' Or just use: tasklist /fi "imagename eq mongoose.exe"
 ' Kill using: taskkill /f /im mongoose.exe
 ' Test this script: cscript //nologo "C:\data\sys\batch\launchmongoose.vbs"
 ' ==============================
 ' Added in version 1.1
 ' ==============================
 ' Features:
 '   - Skips launch if mongoose.exe is already running
 '   - Logs launch attempts to mongoose.log
 ' ==============================
 ' Fixed in version 1.2
 ' ==============================
 ' got rid of errors
 ' ==============================
 ' Improved in version 1.4
 ' ==============================
 ' Removed unconditional launch from version 1.0
 ' ==============================
 ' Improved in version 1.5
 ' ==============================
 ' Due to error: PAC file not available.
 ' Added explicit path to Mongoose launch
 ' WshShell.Run """C:\data\sys\batch\mongoose.exe"" -l http://127.0.0.1:80 -d C:\data\sys\batch", 0, False
 ' This ensures proxy.pac is served correctly regardless of current working directory
 ' ==============================
 
 Set WshShell = CreateObject("WScript.Shell")
 
 Set execCheck = WshShell.Exec("cmd /c tasklist /fi ""imagename eq mongoose.exe"" | find /i ""mongoose.exe""")
 If execCheck.StdOut.ReadAll = "" Then
   ' Mongoose is not running, launch silently
   WshShell.Run """C:\data\sys\batch\mongoose.exe"" -l http://127.0.0.1:80 -d C:\data\sys\batch", 0, False
 
   ' Log the launch
   WshShell.Run """cmd.exe"" /c echo [" & Date & " " & Time & "] Mongoose launched >> C:\data\sys\batch\mongoose.log", 0, False
 Else
   ' Mongoose is already running, skip launch
   WshShell.Run """cmd.exe"" /c echo [" & Date & " " & Time & "] Mongoose already running >> C:\data\sys\batch\mongoose.log", 0, False
 End If
 
Note I tested caddy, miniweb, mongoose & python before settling on mongoose.
-- 
Note that Amazon Vine gives me tens of thousands of dollars worth of "free 
stuff" every year so I needed to keep them happy since they hated proxies.
 <https://amazon.com/vine/about>
And GMail was barfing as were all the AI's, but Copilot is a M$ tool, 
so it's added here (you'll likely want to add all the AI URls to it).

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