feat: Native ExpressVPN HTTPS Proxy Provider (#126)

* feat: add native ExpressVPN HTTPS proxy provider

Introduces ExpressVPN as a first-class native proxy provider for unshackle.

This provider implements the full browser extension proxy authentication flow — from OAuth PKCE bootstrap through subscription validation to authenticated HTTPS proxy endpoints — without requiring any external tools or manual token management.

Supports smart location selection, city-level targeting with intelligent abbreviation matching, and pinned server selection. All tokens are automatically cached and refreshed.

No new dependencies required.

* fix: address PR #126 review feedback

- __repr__ no longer triggers network/OAuth calls; reads cached locations only
- _match_city uses tiered priority buckets (abbrev > exact > prefix > substring)
- Token cache writes race-free: os.open + os.fchmod(0o600) on Unix, fallback on Windows
- Cookie/cache paths resolve under config.directories, not CWD
- _get_connection_token parses response JSON once
- Drop unused PKCE state parameter (never validated)
- Add inline doc for _is_jwt_expired no-exp behavior
- Fix 3 lines exceeding 120-col project style

---------

Co-authored-by: MrMovies-Dev <MrMovies-Dev@users.noreply.github.com>
Co-authored-by: sp4rk.y <george+slight@slight.me>
This commit is contained in:
MrMovies-Dev
2026-06-17 16:51:33 -06:00
committed by GitHub
co-authored by MrMovies-Dev sp4rk.y
parent ba69bc7d61
commit a9c677c349
6 changed files with 919 additions and 13 deletions
+21
View File
@@ -813,6 +813,27 @@ proxy_providers:
# Example: --proxy gluetun:nordvpn:us1239 connects to us1239.nordvpn.com
# Supported providers: nordvpn, surfshark, expressvpn, cyberghost
# ExpressVPN HTTPS Proxy Provider
# Uses browser extension proxy flow with OAuth token authentication.
# Requires exported browser cookies from auth.expressvpn.com (Keycloak session).
# Cookie file: cookies/vpn/expressvpn.txt (or cookies/vpns/expressvpn.txt)
# Token cache: cache/global/expressvpn_tokens.json (auto-managed)
#
# Query formats:
# --proxy expressvpn:us → random US location (smart connection)
# --proxy expressvpn:us-ny → specific city (New York)
# --proxy expressvpn:us-ny-2 → pinned server #2 in New York
# --proxy expressvpn:mx → random Mexico location
# --proxy expressvpn:es-madrid → specific city (Madrid)
#
# expressvpn:
# region_map:
# us: "ny" # Default to New York when --proxy expressvpn:us
# gb: "london" # Default to London when --proxy expressvpn:gb
# es: "madrid" # Default to Madrid when --proxy expressvpn:es
# mx: # Smart connection (random MX location) when --proxy expressvpn:mx
# de: "frankfurt" # Default to Frankfurt when --proxy expressvpn:de
basic:
GB:
- "socks5://username:password@bhx.socks.ipvanish.com:1080" # 1 (Birmingham)