Skip to content

Need EXCLUDE_SNI_REWRITE_SUBDOMAINS_LIST for app_script mode #719

Closed

Description

@TKZ700

Hi, thank you for the recent changes. The setup works perfectly in full_node mode with an exit node.

However as i mentioned in #701 , when using the Google Script -> CF Worker flow (i.e., running the app in app_script mode), Google hosts cannot be proxied as expected.

The root cause:
In app_script mode, all Google subdomains have their SNI rewritten by default. This becomes problematic when trying to reach Google AI Studio because we are connecting to it with our real IP from Iran which will be blocked. so we can bypass the sanctions by connecting to it through app_script proxy, not directly from the Google Script itself, but when a Cloudflare Worker is used as the endpoint of the chain (via Code.cfw.gs).

To successfully connect to Google AI Studio through the app_script -> CF Worker chain, we need to bypass SNI rewriting for certain Google subdomains, so they can be properly proxied and thus circumvent sanctions.

Proposed fix:
Add an EXCLUDE_SNI_REWRITE_SUBDOMAINS_LIST configuration option for app_script mode. This would allow users to specify addresses like Google AI Studio, ensuring they are proxied through the Google Script -> CF Worker pipeline without SNI modification. A similar strategy to what is being used for youtube_through_relay option, but as a list for EXCLUDE SNI REWRITE SUBDOMAINS.

Looking forward to your thoughts.

Activity

  1. o0Fara0o commented on May 4, 2026

    @o0Fara0o

    سلام من نمیتونم سرور رایگان یا val. رو بسازم ...امکانش هست شما برام انجام بدین ؟ مثلا یوزر و پسورد رو بهتون بدم زحمتشو بکشید یا هر روش دیگری که ممکنه ....

  2. o0Fara0o commented on May 4, 2026

    @o0Fara0o

    سلام من نمیتونم سرور رایگان یا val. رو بسازم ...امکانش هست شما برام انجام بدین ؟ مثلا یوزر و پسورد رو بهتون بدم زحمتشو بکشید یا هر روش دیگری که ممکنه ....

  3. therealaleph commented on May 7, 2026

    @therealaleph
    Owner

    Reviewed via Anthropic Claude.

    @TKZ700 — feature request makes sense. Concept: disable_sni_rewrite_hosts: Vec<String> config field that takes precedence over the built-in SNI_REWRITE_SUFFIXES list, forcing matched hosts through the Apps Script relay (→ CF Worker chain) instead of the GFE SNI-rewrite tunnel.

    The precedent already exists in code: youtube_via_relay does exactly this for youtube.com / youtu.be / youtube-nocookie.com / youtubei.googleapis.com. Adding a generic user-configurable list is mostly:

    1. Add field to Config (src/config.rs)
    2. Add a check at the top of matches_sni_rewrite() (src/proxy_server.rs) — if host matches any entry in the user list, return false (= don't SNI-rewrite, fall through to relay path).
    3. UI checkbox / list editor (src/bin/ui.rs)
    4. Tests for both apps_script + apps_script→cfw chain shape.

    Queued — will tag an issue for tracking. Thanks for the clear root-cause writeup; this is the kind of feature ask that's easy to land because the ask is concrete and the architecture already supports it. Leaving open as the tracking issue.

    For your AI Studio use case in the meantime: workaround is editing src/proxy_server.rs locally — change googleapis.com and google.com to be more specific (e.g. scripts.googleapis.com only, drop the broad googleapis.com). But that's unmaintainable across upgrades — better to wait for the proper config knob.

  4. therealaleph commented on May 25, 2026

    @therealaleph
    Owner

    Closing this for now because there has been no follow-up from the issue opener for more than 7 days after the maintainer response.

    If this is still happening on the latest release, please open a fresh issue with the current version, platform, mode, config with secrets removed, and the relevant logs.


    Answered via LLM, Supervised @therealaleph

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