![Build Status Build Status](http://static.javashuo.com/static/loading.gif)
解決的痛點
- 在開發和調試過程當中,常常須要把線上或者平常環境的 CSS、JS 轉發到本地,Charles 等本地代理工具,特別是在全網 HTTPS 化後,變得更加複雜和繁瑣。
- 現有的 Chrome 插件,交互形式,對程序員不是很友好,沒法解決快速定位到某一條規則、快速開關組的需求。
- anyproxy 是不錯的工具,可是在瀏覽器轉發上,配置起來相對麻煩。
XSwitch 的優點
- 基於 Chrome Extension,即裝即用。不須要額外配置其餘環境。
- 基於 Monaco Editor,能夠使用編輯器帶來的快捷操做方式。
- 能夠寫 JSON 註釋。
- 即時保存,即時生效。
- 自動提示頁面上加載到的資源文件,做爲提醒(目前只抓取了 http(s) 的地址,其餘協議的忽略了)
- Open Source
功能
若是設定了以下規則:git
![](http://static.javashuo.com/static/loading.gif)
訪問:https://g.alicdn.com/platform/daily-test/isDaily.js程序員
會進行以下轉發:github
![](http://static.javashuo.com/static/loading.gif)
支持自動提示
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
支持正則匹配
https://github.com/yize/xswitch/blob/master/test/index.spec.jsweb
{
// proxyRules
"proxy": [
[
"//g.alicdn.com/platform/daily-test/(.*).js$",
"//g.alicdn.com/platform/daily-test/$1.json"
],
[
"g.alicdn.com",
"alinw.alicdn.com"
]
]
}
Logo
像是程序員的髮際線
![](http://static.javashuo.com/static/loading.gif)
但願 XSwitch 可以給你們帶來幫助或者想法。chrome
歡迎試用,歡迎提意見。json
Links