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


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

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 09:59 +0000
Organization BWH Usenet Archive (https://usenet.blueworldhosting.com)
Message-ID <10agl6g$2od0$1@nnrp.usenet.blueworldhosting.com> (permalink)
References <10agcdq$2e02$1@nnrp.usenet.blueworldhosting.com> <10agdp4$ngs$1@nnrp.usenet.blueworldhosting.com> <10agf37$15ok$1@nnrp.usenet.blueworldhosting.com> <10aggsa$p1e$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

Included below is an OPTIONAL proxy-checking script that I wrote early on 
which outputs what is happening when Psiphon.bat is setting & unsetting
things, along with Psiphon itself syncing stuff when starts & stops.
 C:\data\sys\batch\checkproxy.bat
 Win+R > checkproxy

Bear in mind, about half the stuff that is checked below is set/unset
by Psiphon while the other half (roughly) is set/unset in my scripts.

That is, if you start Psiphon.exe without the scripts, only about half of 
what actually happens will happen (although I changed the TARGET on the 
original Psiphon link to run the psiphon.bat script so it does it all).
 Change Psiphon.lnk TARGET FROM C:\app\network\psiphon\psiphon3.exe
 Change Psiphon.lnk TARGET TO C:\data\sys\batch\psiphon.bat

When the custom psiphon.bat script modifies system proxy configurations to 
route traffic through Psiphon's secure tunnel, here's what it changes:

1. WinINET (used by Internet Explorer and some legacy apps):
    Psiphon does not enable a manual proxy here by default.
    Proxy remains DISABLED unless manually set.

2. WinHTTP (used by system services and background tasks):
    Initially set to "Direct access" (no proxy).
    Psiphon syncs WinINET settings into WinHTTP.
    Eventually sets WinHTTP proxy to:
     http=127.0.0.1:63750
     https=127.0.0.1:63750
     socks=127.0.0.1:1080
    Adds a bypass list for local and private IP ranges.

3. PAC (Proxy Auto-Config) and AutoDetect:
   Before Psiphon: no PAC URL, Auto-Detect is DISABLED.
   After Psiphon:
    Sets PAC URL to http://127.0.0.1/proxy.pac
    Enables Auto-Detect
    PAC logic routes Gmail, Amazon Vine & Copilot directly
    & sends other traffic through SOCKS proxy at 127.0.0.1:1080

In summary, the custom proxy client... 
 a. Sets a PAC script URL in the registry.
 a. Enables Auto-Detect to apply PAC logic.
 a. Syncs proxy settings from WinINET to WinHTTP.
 a. Configures WinHTTP to use Psiphon's local proxy ports.
 a. Leaves WinINET proxy disabled unless manually overridden.

This setup ensures that most apps and services follow the PAC logic and 
route traffic through Psiphon's encrypted tunnel, while exempting trusted 
domains and local addresses.

Note that every file can be run via a doubleclick in the file explorer, or 
it can be run in a Runbox via a custom 'App Paths' registry key, but in 
general, everything is connected together by the main psiphon.bat script.
 Win+R > psiphon

When you run the Psiphon SOCKS5 GUI, it automatically changes certain 
Windows proxy settings while it is active, and then reverts them when 
you close it.

1. The PAC script URL in the WinINET (Internet Settings) registry key:
   HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\AutoConfigURL
   This is set to something like http://127.0.0.1/proxy.pac 
   when Psiphon is running, and cleared when it stops.

2. The Auto-Detect setting in the same key:
   HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\AutoDetect
   This is enabled when Psiphon is running with PAC logic, 
   and disabled when it stops.

3. The WinHTTP proxy configuration:
   'netsh winhttp show proxy' will show Psiphon's local HTTP, 
   HTTPS & SOCKS ports while it is active & Direct access 
  (no proxy server) after it closes.

4. Optionally, Mongoose serves proxy.pac & listens on the localhost.
   Mongoose is not responsible for setting registry keys or 
   configuring proxy settings itself, Instead, its role is limited to
   Serving the PAC file (proxy.pac) over HTTP at http://127.0.0.1/proxy.pac
   Listening on localhost to respond to Windows requests for the PAC script
   Enabling dynamic retrieval of PAC logic when AutoConfigURL is set

In short, Psiphon's GUI automatically adjusts key Windows proxy settings 
while active, then reverts them when closed. Specifically:
 a. It sets the PAC script URL in the registry to http://127.0.0.1/proxy.pac.
 b. It enables the Auto-Detect flag so Windows applies PAC logic.
 c. It configures WinHTTP to use Psiphon's local proxy ports (HTTP, HTTPS & SOCKS).
 d. It clears those settings when Psiphon exits, restoring direct access.

Together, Psiphon & my custom scripts create a unified proxy environment. 
Traffic is routed securely through Psiphon's tunnel where finicky domains 
(such as Amazon Vine, Google GMail & Microsoft AI clients) are bypassed, 
and local addresses are excluded. 

When the tunnel closes, everything reverts cleanly to default behavior.
Here is an OPTIONAL custom script which simply reports what's happened.

 @echo off
 REM C:\data\sys\batch\checkproxy.bat 20250916 
 REM This is version 1.2
 REM Custom unified Windows proxy diagnostic tool
 REM v1.0 lists WinINET manual proxy, WinHTTP proxy, PAC/AutoDetect
 REM v1.1 replaces echo. with echo( to avoid command misinterpretation
 REM v1.2 adds PAC file existence check and SHA256 hash logging (114 lines)

 setlocal
 
 set KEY="HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
 set PACFILE=C:\data\sys\batch\proxy.pac
 
 echo ==============================================
 echo   WINDOWS PROXY CONFIGURATION CHECK
 echo ==============================================
 
 REM --- PAC file existence check ---
 if not exist "%PACFILE%" (
     echo WARNING: PAC file not found at %PACFILE%
 ) else (
     echo PAC file found at %PACFILE%
     echo PAC file SHA256 hash:
     certutil -hashfile "%PACFILE%" SHA256
 )
 
 REM --- WinINET (manual proxy) ---
 echo(
 echo [1] WinINET / Internet Settings
 for /f "tokens=2,* skip=2" %%A in ('reg query %KEY% /v ProxyEnable 2^>nul') do set ProxyEnable=%%B
 for /f "tokens=2,* skip=2" %%A in ('reg query %KEY% /v ProxyServer 2^>nul') do set ProxyServer=%%B
 if "%ProxyEnable%"=="0x1" (
     echo Proxy is ENABLED
     echo Proxy server: %ProxyServer%
 ) else (
     echo Proxy is DISABLED
 )
 
 REM --- WinHTTP proxy ---
 echo(
 echo [2] WinHTTP proxy (system/background services)
 netsh winhttp show proxy
 
 REM --- PAC (Proxy Auto-Config) & AutoDetect ---
 echo(
 echo [3] PAC / AutoDetect
 for /f "tokens=2,* skip=2" %%A in ('reg query %KEY% /v AutoConfigURL 2^>nul') do set PACurl=%%B
 for /f "tokens=2,* skip=2" %%A in ('reg query %KEY% /v AutoDetect 2^>nul') do set AutoDetect=%%B
 
 if defined PACurl (
     echo PAC script set: %PACurl%
 ) else (
     echo No PAC script URL found.
 )
 
 if "%AutoDetect%"=="0x1" (
     echo Auto-detect is ENABLED
 ) else (
     echo Auto-detect is DISABLED
 )
 
 echo(
 echo ==============================================
 echo Check complete.
 echo ==============================================
 
 endlocal
 pause
-- 
Efficiency is turning 4 clicks into 3 & 3 clicks into 2 & 2 clicks into 1. 

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