Skip to content

Grab proxy endpoint#154

Draft
aidenybai wants to merge 2 commits intomainfrom
cursor/grab-proxy-endpoint-fa2e
Draft

Grab proxy endpoint#154
aidenybai wants to merge 2 commits intomainfrom
cursor/grab-proxy-endpoint-fa2e

Conversation

@aidenybai
Copy link
Owner

@aidenybai aidenybai commented Feb 5, 2026

Adds a /proxy route to enable proxying of external websites, injecting the React Grab script, and rewriting all assets through the proxy for enhanced functionality and security.


Open in Cursor Open in Web


Summary by cubic

Added an edge /proxy endpoint to load external sites and inject the React Grab script. It now uses a tag and only proxies HTML for better compatibility.

  • New Features
    • GET /proxy?url=... fetches HTML and injects + React Grab.
    • Rejects non-HTML; assets load from the original domain.
    • Blocks adult, gambling, malware, piracy, and self-referential domains.
    • Adds X-Frame-Options: SAMEORIGIN and X-Content-Type-Options: nosniff on /proxy.

Written for commit d87f3bd. Summary will update on new commits.

- Add Edge runtime proxy route at /proxy?url=<target>
- Inject React Grab script into proxied HTML pages
- Rewrite all relative URLs (href, src, srcset, CSS url()) to go through proxy
- Add domain blocklist for adult/gambling/malware/piracy sites
- Handle CSS @import and url() rewriting
- Add security headers in vercel.json

Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
@cursor
Copy link

cursor bot commented Feb 5, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@vercel
Copy link

vercel bot commented Feb 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-grab-website Ready Ready Preview, Comment Feb 5, 2026 6:56am

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 5, 2026

Open in StackBlitz

@react-grab/cli

npm i https://pkg.pr.new/aidenybai/react-grab/@react-grab/cli@154

grab

npm i https://pkg.pr.new/aidenybai/react-grab/grab@154

@react-grab/ami

npm i https://pkg.pr.new/aidenybai/react-grab/@react-grab/ami@154

@react-grab/amp

npm i https://pkg.pr.new/aidenybai/react-grab/@react-grab/amp@154

@react-grab/claude-code

npm i https://pkg.pr.new/aidenybai/react-grab/@react-grab/claude-code@154

@react-grab/codex

npm i https://pkg.pr.new/aidenybai/react-grab/@react-grab/codex@154

@react-grab/cursor

npm i https://pkg.pr.new/aidenybai/react-grab/@react-grab/cursor@154

@react-grab/droid

npm i https://pkg.pr.new/aidenybai/react-grab/@react-grab/droid@154

@react-grab/gemini

npm i https://pkg.pr.new/aidenybai/react-grab/@react-grab/gemini@154

@react-grab/opencode

npm i https://pkg.pr.new/aidenybai/react-grab/@react-grab/opencode@154

react-grab

npm i https://pkg.pr.new/aidenybai/react-grab@154

@react-grab/relay

npm i https://pkg.pr.new/aidenybai/react-grab/@react-grab/relay@154

@react-grab/utils

npm i https://pkg.pr.new/aidenybai/react-grab/@react-grab/utils@154

commit: d87f3bd

Simplifies the proxy implementation significantly:
- Injects <base href='original-domain'> to resolve all relative URLs
- Removes complex URL rewriting logic that broke with dynamic imports
- Works correctly with Next.js and other SPAs that use code splitting
- Only proxies HTML pages now (returns error for direct asset requests)

This approach lets all scripts/styles/images load directly from the
original domain while still injecting React Grab into the HTML.

Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments