Skip to content

EnockLee/ip-log

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

ip-log.ps1

A lightweight PowerShell script to detect and record network exit IP status
without relying on browsers or proxy-aware tools.

It helps identify LAN IP, China direct exit IP, Japan direct exit IP,
and proxy exit IP, with idempotent logging for long-term observation.


Features

  • Detect local LAN IPv4 address
  • Identify China direct exit IP (HTTP, PAC-unaffected)
  • Multi-API voting to determine international direct exit IP
  • Detect proxy exit IP via blocked HTTPS endpoint
  • PAC / proxy status classification
  • Idempotent log writing (no duplicate records)
  • No browser or GUI dependency

Output Fields

Each log record contains:

  • REAL_LAN – Local LAN IPv4 address
  • CN_EXIT – China direct exit IP
  • JP_DIRECT_EXIT – Direct international exit IP (consensus)
  • PROXY_EXIT – Proxy exit IP
  • STATUS – Network status classification

STATUS Values

STATUS Meaning
NO_PROXY No proxy detected
MIXED_PROXY Proxy exit differs from direct exit
PAC_ONLY_BLOCKED PAC blocks HTTPS but direct exit unchanged
UNKNOWN Insufficient data

Example Output

2026-02-05 03:11:22 | REAL_LAN=192.168.1.10 | CN_EXIT=1.2.3.4 | JP_DIRECT_EXIT=5.6.7.8 | PROXY_EXIT=9.9.9.9 | STATUS=MIXED_PROXY

Usage

Run the following command in PowerShell:

powershell -ExecutionPolicy Bypass -File ip-log.ps1

The script writes records to log.txt in the same directory.

Use Cases

  • Verify PAC / proxy routing behavior
  • Observe network exit changes over time
  • Diagnose mixed proxy environments
  • Lightweight network exit auditing on Windows

License

MIT License

About

出口IP记录仪

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors