Metadata-Version: 2.4
Name: hjindep-egress
Version: 0.2.0
Summary: Observe configured application HTTP egress and compare proxy-aware and proxy-free exit IPs.
Author-email: YrralH <hj00@tju.edu.cn>
License-Expression: MIT
Project-URL: Homepage, https://github.com/YrralH/hjindep-egress
Project-URL: Issues, https://github.com/YrralH/hjindep-egress/issues
Keywords: egress,proxy,network,geolocation,cli
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet
Classifier: Topic :: System :: Networking :: Monitoring
Classifier: Typing :: Typed
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: cli
Requires-Dist: typer<1,>=0.12; extra == "cli"
Requires-Dist: certifi>=2024.2.2; extra == "cli"
Dynamic: license-file

# hjindep-egress

Observe the public exit IP reached through configured application HTTP routes.
The default command covers shell, wget, pip, Git, Codex, Claude and VS Code
Desktop/Server scenarios. It reports route evidence and missing context instead
of assuming that an installed application is running in a particular shell.

This is an **egress observation**, not a service connection or availability test.
The trace request follows inferred configuration; it does not observe a real
application backend's launch environment. Different destinations may use different
VPN routes, and the probe's TLS policy may differ from the native application's.

## Install

Requires Python 3.12+. The public library has zero third-party dependencies.
The application CLI needs the optional Typer and certifi dependencies:

```sh
pip install hjindep-egress
pip install "hjindep-egress[cli]"
```

## Use

```sh
hjindep-egress                         # all application scenarios
hjindep-egress all --format json --no-geo
hjindep-egress git --details
hjindep-egress vscode --no-fullscreen
hjindep-egress compare                 # previous two-path command
hjindep-egress compare --watch
```

Version 0.2 changes the bare CLI default to `all`. Existing two-path options,
including `--compact` and `--watch`, now follow `compare`. The public Python API
and comparison JSON schema remain unchanged. Application JSON uses schema 3;
comparison JSON uses schema 2. See [usage](docs/usage.md) for options, return codes
and configuration boundaries.

`compare` observes the environment-aware and explicit-proxy-free paths.
`same_exit: true` means their public IPs are equal; it does **not** prove that a
proxy was unused. Transparent gateways and VPNs can affect either path.

```python
from hjindep_egress import observe_egress_status

status = observe_egress_status()
print(status.status, status.same_exit)
print(status.application.ip, status.proxy_free.ip)
```

## Platform and validation

Pure Python, with POSIX and Windows cache locking and platform-specific static
editor discovery. Both strict Pyright configurations cover source and tests.
Platform-specific runtime tests need their corresponding OS. Run tests with
`python -m pytest`; local TLS fixtures require `openssl` on PATH. No external
network is needed by the test suite. Read [architecture](docs/design.md) for the
core/CLI dependency boundary and packaging checks.

Exit IP discovery uses `https://cloudflare.com/cdn-cgi/trace`; optional approximate
geolocation uses `https://ipwho.is/<ip>` and a bounded user-local cache. No daemon
or privileged installation is required. Configuration is read without rewriting
application settings.

## Stability

Pin the version you test against; compatibility across future versions is not
promised. Report problems through the repository's issue tracker.
