Skip to content

passthrough for selected IPs #39

Closed

Description

@ali-exacute

as the title suggest, it would be very useful if we can whitelist IPs or URLs to not go through the relay

i am not 100% sure if this is already somewhat what the app does or not, but adding them manually could be very useful and also lower the amount of token used!

Activity

  1. changed the title [-]passthrough for selected URLs[/-] [+]passthrough for selected IPs[/+] on Apr 23, 2026
  2. therealaleph commented on Apr 23, 2026

    @therealaleph
    Owner

    Good request. State of play:

    Already-passing-through (no relay):

    • Google edges handshaked via SNI-rewrite (traffic goes direct to google_ip:443, Apps Script is not involved) — the list is in SNI_REWRITE_SUFFIXES: google.com, youtube.com, gstatic.com, googleusercontent.com, googleapis.com, ytimg.com, gvt1.com, gvt2.com, doubleclick.net, googlesyndication.com, googleadservices.com, google-analytics.com, googletagmanager.com, googletagservices.com, fonts.googleapis.com. This list is compile-time; open a PR if you want more default entries.
    • Plain-TCP SOCKS passthrough for non-HTTP/non-TLS targets (SSH, DNS, etc.) doesn't hit the relay.
    • v1.2.0 adds a google_only mode that reverses the default: everything non-Google goes direct instead of relayed.

    User-configurable passthrough list: not yet implemented but a reasonable add — tracking this issue as the feature request for a passthrough_hosts: ["example.com", "1.2.3.4"] config field that the MITM boundary would honour with an early tunnel-no-MITM branch. Will ship in a future release.

  3. therealaleph commented on Apr 23, 2026

    @therealaleph
    Owner

    Quick update — while triaging related issues (#69 asked essentially the same thing) I reviewed what's automatic today:

    Already passthrough (bypasses Apps Script relay):

    • All .google.com, YouTube family, gvt1/gvt2, doubleclick, googlesyndication, googleadservices, google-analytics, googletagmanager, googletagservices, fonts.googleapis, googleusercontent, gstatic, googleapis, ggpht — routed direct via SNI-rewrite tunnel (no quota cost).
    • All non-TLS traffic (SSH, DNS on non-standard ports, IMAP/POP without STARTTLS, etc.) — plain TCP passthrough, no quota cost.
    • In google_only mode (v1.2.0+): everything non-Google goes direct instead of relayed.

    Not yet user-configurable: a passthrough_hosts: ["example.com", "1.2.3.4/24"] list you can add to config.json for sites you want to skip the relay on a per-case basis. This is still a valid feature request — tracking this issue for it. Implementing it is straightforward; the hold-up is deciding the right shape (hostname suffix vs glob vs CIDR, and whether it should also apply in MITM path for HTTPS-to-non-Google).

    Keeping open.


    [reply via Anthropic Claude | reviewed by @therealaleph]

  4. therealaleph commented on Apr 24, 2026

    @therealaleph
    Owner

    Shipped in commit 889f94c — new passthrough_hosts: [] config field. Each entry is a hostname (or .domain.tld suffix for subdomain matching) that bypasses Apps Script relay entirely and passes through as plain TCP, optionally via upstream_socks5 if set.

    Example config.json:

    {
      "mode": "apps_script",
      "...": "...",
      "passthrough_hosts": [
        "api.specialsite.com",
        ".internal.corp",
        "banking.local"
      ]
    }

    Matching rules (case-insensitive, trailing dots normalized):

    • Exact: "example.com" → only example.com
    • Suffix: ".example.com" → example.com itself AND any subdomain (a.example.com, x.y.example.com, etc.)

    Dispatch order puts this first, so a match wins over SNI-rewrite, google_only passthrough, Apps Script MITM, and even Full Tunnel Mode. 5 unit tests cover exact / suffix / case / whitespace / trailing-dot edges.

    Closes this — will land in the next tagged release.


    [reply via Anthropic Claude | reviewed by @therealaleph]

  5. added a commit that references this issue on Apr 24, 2026
    889f94c
  6. added a commit that references this issue on Apr 25, 2026
    fe9328e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions