English | 简体中文
AnyProxy is a powerful Chrome extension that allows you to easily redirect network resources without server-side modifications. It provides a flexible way to forward any web requests to different destinations using regex-based rules.
- Simple Configuration: Set up forwarding rules with regex patterns
- No Server Changes: Redirect requests without modifying the target server
- Real-time Updates: Rules take effect immediately without browser restart
- Developer Friendly: Perfect for local development and testing
- Resource Types: Support for JavaScript, CSS, and API
- Frontend developers testing local changes
- QA engineers comparing different versions
- Debug and troubleshoot network issues
- A/B testing without server deployment
The proxy configuration consists of two parts in each array element:
- First value corresponds to
regexFilter - Second value corresponds to
regexSubstitution
For detailed information, please refer to:
Note: The only difference is that capture group references in regexSubstitution are changed from \1-\9 to $1-$9.
{
"proxy": [
[
"https://developer.mozilla.org/static/js/chunk.js",
"http://localhost:3000/js/proxy.js"
],
[
"https://developer.mozilla.org/(.*)/js/chunk.js",
"http://localhost:3000/$1/proxy.js"
],
[
"https://developer.mozilla.org/(.*)/js/(.*).js",
"http://localhost:3000/$1/$2.js"
]
]
}graph TB
Storage["browser.storage.local"]
UI["UI Components"]
BG["background.ts"]
CT["content.ts"]
CM["content-main.ts"]
UI -->|"write config"| Storage
UI -->|"runtime.sendMessage"| BG
Storage -.->|"storage.onChanged"| BG
Storage -.->|"storage.onChanged"| CT
CT <-->|"window.postMessage"| CM
BG -.->|"manages"| DN["declarativeNetRequest"]
CM -.->|"intercepts"| NET["fetch / XHR"]
style Storage fill:#fff9c4,stroke:#f57f17,stroke-width:2px
style BG fill:#f3e5f5
style CT fill:#fff3e0
style CM fill:#e3f2fd