├── .babelrc ├── .eslintrc.js ├── .github └── workflows │ ├── build-doc.yml │ └── build.yml ├── .gitignore ├── .npmrc ├── .prettierrc.js ├── .yarnclean ├── LICENSE ├── README.md ├── app ├── main.js ├── package-lock.json └── package.json ├── art └── icon │ ├── index-pure.html │ └── index.html ├── docs ├── .editorconfig ├── .gitignore ├── .prettierignore ├── .prettierrc ├── .umirc.ts ├── README.md ├── docs │ ├── doc │ │ ├── capture-network.md │ │ ├── capture-network.zh-CN.md │ │ ├── cli.md │ │ ├── cli.zh-CN.md │ │ ├── faq.md │ │ ├── faq.zh-CN.md │ │ ├── getting-started.md │ │ ├── getting-started.zh-CN.md │ │ ├── remote-debug.md │ │ ├── remote-debug.zh-CN.md │ │ ├── use-with-umi-antd-pro.md │ │ ├── use-with-umi-antd-pro.zh-CN.md │ │ ├── wireless.md │ │ ├── wireless.zh-CN.md │ │ ├── write-rule-in-nodejs.md │ │ └── write-rule-in-nodejs.zh-CN.md │ ├── imgs │ │ ├── add-btn.png │ │ ├── check-status.png │ │ ├── devtools.png │ │ ├── group-dingtalk.png │ │ ├── install.png │ │ ├── ios-install-cert.png │ │ ├── ios-scan-qr.jpeg │ │ ├── ios-settings.jpeg │ │ ├── ios-trust-cert.png │ │ ├── ios-wifi-settings.png │ │ ├── menubar-copy-shell.png │ │ ├── mock-json-result.png │ │ ├── mock-json.png │ │ ├── network-capture.png │ │ ├── preview-network.png │ │ ├── preview-new.png │ │ ├── quick-rule-nodejs-result.png │ │ ├── quick-rule-nodejs.png │ │ ├── quick-rule.png │ │ ├── remote-debug.png │ │ ├── security-open-anyway.png │ │ ├── use-with-umi.png │ │ └── wireless-tab.png │ ├── index.md │ ├── index.zh-CN.md │ └── rules │ │ ├── match.md │ │ └── match.zh-CN.md ├── package.json ├── tsconfig.json └── typings.d.ts ├── license_third_party ├── proxy_conf_helper │ └── LICENSE.md └── whistle │ └── LICENSE.md ├── package.json ├── scripts ├── sync-version.js └── update-node.js ├── src ├── index.ejs ├── main │ ├── api.ts │ ├── boradcast-manager.ts │ ├── const.ts │ ├── index.ts │ ├── install.ts │ ├── main.ts │ ├── platform.ts │ ├── splash.ts │ ├── switch-entry.ts │ └── updater.ts └── renderer │ ├── components │ ├── app │ │ ├── index.less │ │ └── index.tsx │ ├── index.less │ └── status-bar │ │ ├── index.less │ │ └── index.tsx │ ├── const.ts │ ├── core-api.ts │ ├── extension.tsx │ ├── extensions │ ├── index.ts │ ├── phone-proxy │ │ ├── index.less │ │ └── index.tsx │ ├── rule-editor │ │ ├── components │ │ │ ├── card │ │ │ │ ├── index.less │ │ │ │ └── index.tsx │ │ │ ├── editor │ │ │ │ ├── index.less │ │ │ │ ├── index.tsx │ │ │ │ └── rule-language │ │ │ │ │ ├── protocols.ts │ │ │ │ │ └── rule.ts │ │ │ └── rule-list │ │ │ │ ├── index.less │ │ │ │ ├── index.tsx │ │ │ │ └── remote.ts │ │ ├── index.less │ │ └── index.tsx │ ├── setting │ │ ├── components │ │ │ └── setting-form │ │ │ │ ├── index.less │ │ │ │ └── index.tsx │ │ ├── index.less │ │ └── index.tsx │ ├── weinre │ │ ├── index.less │ │ └── index.tsx │ ├── whistle-panel │ │ ├── index.less │ │ └── index.tsx │ └── whistle │ │ ├── helper-menus │ │ └── index.tsx │ │ ├── index.less │ │ └── index.tsx │ ├── hooks │ ├── use-app-extension-panels.ts │ ├── use-current-window.ts │ └── use-theme-mode.tsx │ ├── i18n.ts │ ├── index.tsx │ ├── style │ └── theme │ │ ├── antd-dark.less │ │ ├── base.less │ │ ├── dark.lazy.less │ │ └── default.lazy.less │ └── utils.ts ├── tsconfig.json ├── vendor ├── build │ └── icon.icns ├── files │ ├── icon-pure.png │ ├── icon.icns │ ├── icon.ico │ ├── icon.png │ ├── iconTemplate.png │ ├── iconTemplate@2x.png │ ├── node │ │ ├── .yarnclean │ │ └── package.json │ ├── proxy_conf_helper │ └── win_proxy_helper.exe ├── proxy_conf_helper │ ├── BRLOptionParser │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── BRLOptionParser.podspec │ │ ├── BRLOptionParser.xcodeproj │ │ │ ├── project.pbxproj │ │ │ ├── project.xcworkspace │ │ │ │ └── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── xcschemes │ │ │ │ └── BRLOptionParser.xcscheme │ │ ├── BRLOptionParser.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── BRLOptionParser.xccheckout │ │ │ │ └── WorkspaceSettings.xcsettings │ │ ├── BRLOptionParser │ │ │ ├── BRLOptionParser.h │ │ │ └── BRLOptionParser.m │ │ ├── BRLOptionParserTests │ │ │ ├── BRLOptionParserTests-Info.plist │ │ │ └── BRLOptionParserTests.m │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── Podfile │ │ └── README.markdown │ ├── build.sh │ └── main.m ├── static │ ├── icon.icns │ └── icon.png ├── whistle-start │ ├── index.js │ └── package.json ├── whistle.chii-internal │ ├── .eslintrc.js │ ├── .gitignore │ ├── .npmignore │ ├── .travis.yml │ ├── README.md │ ├── _rules.txt │ ├── index.js │ ├── lib │ │ └── uiServer.js │ ├── package.json │ └── prettier.config.js ├── whistle.scriptfile │ ├── .babelrc │ ├── .editorconfig │ ├── .eslintrc │ ├── .gitignore │ ├── .npmignore │ ├── LICENSE │ ├── README.md │ ├── index.js │ ├── lib │ │ ├── WebSocket.js │ │ ├── WebSocketServer.js │ │ ├── agent │ │ │ ├── agent.js │ │ │ └── index.js │ │ ├── dataSource.js │ │ ├── index.js │ │ ├── logger.js │ │ ├── resRulesServer.js │ │ ├── rulesServer.js │ │ ├── scripts.js │ │ ├── server.js │ │ ├── tunnelRulesServer.js │ │ ├── tunnelServer.js │ │ ├── uiServer │ │ │ ├── cgi-bin │ │ │ │ ├── active.js │ │ │ │ ├── create.js │ │ │ │ ├── delete.js │ │ │ │ ├── emitData.js │ │ │ │ ├── init.js │ │ │ │ ├── log.js │ │ │ │ ├── rename.js │ │ │ │ ├── setFontSize.js │ │ │ │ ├── setTheme.js │ │ │ │ └── showLineNumbers.js │ │ │ ├── index.js │ │ │ └── router.js │ │ ├── util.js │ │ └── wsServer.js │ ├── package.json │ ├── public │ │ ├── index.html │ │ └── index.js │ └── src │ │ ├── css │ │ ├── base.css │ │ ├── console.css │ │ ├── divider.css │ │ ├── editor-settings.css │ │ ├── editor.css │ │ ├── filter-input.css │ │ ├── index.css │ │ ├── list.css │ │ ├── menu-item.css │ │ └── menu.css │ │ ├── js │ │ ├── base-css.js │ │ ├── cgi.js │ │ ├── console.js │ │ ├── data-center.js │ │ ├── divider.js │ │ ├── editor-settings.js │ │ ├── editor.js │ │ ├── filter-input.js │ │ ├── index.js │ │ ├── list-modal.js │ │ ├── list.js │ │ ├── menu-item.js │ │ └── util.js │ │ └── webpack.config.js ├── whistle │ ├── .babelrc │ ├── .editorconfig │ ├── .eslintignore │ ├── .eslintrc │ ├── .gitignore │ ├── .npmignore │ ├── .travis.yml │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README-zh_CN.md │ ├── README.md │ ├── assets │ │ ├── fiddler │ │ │ └── meta.xml │ │ ├── js │ │ │ ├── log.js │ │ │ └── weinre.js │ │ ├── launcher │ │ │ ├── README.md │ │ │ ├── linux │ │ │ │ ├── README.md │ │ │ │ └── whistle.gif │ │ │ ├── mac │ │ │ │ ├── README.md │ │ │ │ ├── whistle-desktop.gif │ │ │ │ ├── whistle.gif │ │ │ │ └── whistle.zip │ │ │ └── windows │ │ │ │ ├── README.md │ │ │ │ ├── whistle.gif │ │ │ │ └── whistle.zip │ │ └── menu.html │ ├── bin │ │ ├── plugin.js │ │ ├── status.js │ │ ├── use.js │ │ ├── util.js │ │ └── whistle.js │ ├── biz │ │ ├── index.js │ │ ├── init.js │ │ ├── webui │ │ │ ├── cgi-bin │ │ │ │ ├── abort.js │ │ │ │ ├── check-update.js │ │ │ │ ├── composer.js │ │ │ │ ├── create-cert.js │ │ │ │ ├── custom-frames.js │ │ │ │ ├── custom-handler.js │ │ │ │ ├── do-not-show-again.js │ │ │ │ ├── download.js │ │ │ │ ├── enable-http2.js │ │ │ │ ├── get-custom-certs-files.js │ │ │ │ ├── get-custom-certs-info.js │ │ │ │ ├── get-data.js │ │ │ │ ├── get-frames.js │ │ │ │ ├── get-session.js │ │ │ │ ├── hide-https-connects.js │ │ │ │ ├── history.js │ │ │ │ ├── import-remote.js │ │ │ │ ├── init.js │ │ │ │ ├── intercept-https-connects.js │ │ │ │ ├── log │ │ │ │ │ └── set.js │ │ │ │ ├── plugins │ │ │ │ │ ├── disable-all-plugins.js │ │ │ │ │ ├── disable-plugin.js │ │ │ │ │ ├── get-plugins.js │ │ │ │ │ ├── is-enable.js │ │ │ │ │ └── update-rules.js │ │ │ │ ├── reset-local-address.js │ │ │ │ ├── rootca.js │ │ │ │ ├── rules │ │ │ │ │ ├── add.js │ │ │ │ │ ├── allow-multiple-choice.js │ │ │ │ │ ├── disable-all-rules.js │ │ │ │ │ ├── disable-default.js │ │ │ │ │ ├── enable-back-rules-first.js │ │ │ │ │ ├── enable-default.js │ │ │ │ │ ├── export.js │ │ │ │ │ ├── import.js │ │ │ │ │ ├── index.js │ │ │ │ │ ├── list.js │ │ │ │ │ ├── list2.js │ │ │ │ │ ├── move-to.js │ │ │ │ │ ├── project.js │ │ │ │ │ ├── recycle │ │ │ │ │ │ ├── list.js │ │ │ │ │ │ ├── remove.js │ │ │ │ │ │ └── view.js │ │ │ │ │ ├── remove.js │ │ │ │ │ ├── rename.js │ │ │ │ │ ├── select.js │ │ │ │ │ ├── set-sys-hosts.js │ │ │ │ │ └── unselect.js │ │ │ │ ├── server-info.js │ │ │ │ ├── sessions │ │ │ │ │ ├── expimp.js │ │ │ │ │ ├── export.js │ │ │ │ │ └── import.js │ │ │ │ ├── set-custom-column.js │ │ │ │ ├── socket │ │ │ │ │ ├── abort.js │ │ │ │ │ ├── change-status.js │ │ │ │ │ └── data.js │ │ │ │ ├── util.js │ │ │ │ └── values │ │ │ │ │ ├── add.js │ │ │ │ │ ├── check-file.js │ │ │ │ │ ├── download.js │ │ │ │ │ ├── export.js │ │ │ │ │ ├── get.js │ │ │ │ │ ├── import.js │ │ │ │ │ ├── index.js │ │ │ │ │ ├── list.js │ │ │ │ │ ├── list2.js │ │ │ │ │ ├── move-to.js │ │ │ │ │ ├── recycle │ │ │ │ │ ├── list.js │ │ │ │ │ ├── remove.js │ │ │ │ │ └── view.js │ │ │ │ │ ├── remove-file.js │ │ │ │ │ ├── remove.js │ │ │ │ │ ├── rename.js │ │ │ │ │ └── upload.js │ │ │ ├── htdocs.js │ │ │ ├── htdocs │ │ │ │ ├── editor.html │ │ │ │ ├── img │ │ │ │ │ ├── favicon.ico │ │ │ │ │ ├── qrcode.png │ │ │ │ │ └── whistle.png │ │ │ │ ├── index.html │ │ │ │ ├── js │ │ │ │ │ └── index.js │ │ │ │ ├── preview.html │ │ │ │ └── src │ │ │ │ │ ├── css │ │ │ │ │ ├── about.css │ │ │ │ │ ├── add-rule.css │ │ │ │ │ ├── base.css │ │ │ │ │ ├── btn-group.css │ │ │ │ │ ├── certs.css │ │ │ │ │ ├── composer.css │ │ │ │ │ ├── context-menu.css │ │ │ │ │ ├── detail.css │ │ │ │ │ ├── divider.css │ │ │ │ │ ├── dropdown.css │ │ │ │ │ ├── editor-settings.css │ │ │ │ │ ├── editor.css │ │ │ │ │ ├── files-dialog.css │ │ │ │ │ ├── filter-input.css │ │ │ │ │ ├── frames.css │ │ │ │ │ ├── image-view.css │ │ │ │ │ ├── index.css │ │ │ │ │ ├── json-viewer.css │ │ │ │ │ ├── kv.css │ │ │ │ │ ├── list-dialog.css │ │ │ │ │ ├── list.css │ │ │ │ │ ├── menu-item.css │ │ │ │ │ ├── message.css │ │ │ │ │ ├── modal.css │ │ │ │ │ ├── network-settings.css │ │ │ │ │ ├── online.css │ │ │ │ │ ├── overview.css │ │ │ │ │ ├── plugins.css │ │ │ │ │ ├── properties.css │ │ │ │ │ ├── props-editor.css │ │ │ │ │ ├── record-btn.css │ │ │ │ │ ├── req-data.css │ │ │ │ │ ├── req-detail.css │ │ │ │ │ ├── res-detail.css │ │ │ │ │ ├── sync-dialog.css │ │ │ │ │ ├── table.css │ │ │ │ │ ├── textarea.css │ │ │ │ │ ├── timeline.css │ │ │ │ │ ├── tools.css │ │ │ │ │ └── values.css │ │ │ │ │ ├── js │ │ │ │ │ ├── about.js │ │ │ │ │ ├── add-rule-dialog.js │ │ │ │ │ ├── base-css.js │ │ │ │ │ ├── btn-group.js │ │ │ │ │ ├── certs-info-dialog.js │ │ │ │ │ ├── cgi.js │ │ │ │ │ ├── columns.js │ │ │ │ │ ├── components │ │ │ │ │ │ ├── json │ │ │ │ │ │ │ ├── eval.js │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ ├── parse.js │ │ │ │ │ │ │ └── stringify.js │ │ │ │ │ │ └── react-json-tree │ │ │ │ │ │ │ ├── ItemRange.js │ │ │ │ │ │ │ ├── JSONArrayNode.js │ │ │ │ │ │ │ ├── JSONArrow.js │ │ │ │ │ │ │ ├── JSONIterableNode.js │ │ │ │ │ │ │ ├── JSONNestedNode.js │ │ │ │ │ │ │ ├── JSONNode.js │ │ │ │ │ │ │ ├── JSONObjectNode.js │ │ │ │ │ │ │ ├── JSONValueNode.js │ │ │ │ │ │ │ ├── createStylingFromTheme.js │ │ │ │ │ │ │ ├── getCollectionEntries.js │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ ├── objType.js │ │ │ │ │ │ │ ├── themes │ │ │ │ │ │ │ └── solarized.js │ │ │ │ │ │ │ └── utils │ │ │ │ │ │ │ └── hexToRgb.js │ │ │ │ │ ├── composer.js │ │ │ │ │ ├── console.js │ │ │ │ │ ├── context-menu.js │ │ │ │ │ ├── copy-btn.js │ │ │ │ │ ├── data-center.js │ │ │ │ │ ├── detail-dialog.js │ │ │ │ │ ├── detail.js │ │ │ │ │ ├── dialog.js │ │ │ │ │ ├── divider.js │ │ │ │ │ ├── dropdown.js │ │ │ │ │ ├── editor-settings.js │ │ │ │ │ ├── editor.js │ │ │ │ │ ├── events.js │ │ │ │ │ ├── expand-collapse.js │ │ │ │ │ ├── favorites.js │ │ │ │ │ ├── files-dialog.js │ │ │ │ │ ├── filter-btn.js │ │ │ │ │ ├── filter-input.js │ │ │ │ │ ├── frame-composer.js │ │ │ │ │ ├── frame-data.js │ │ │ │ │ ├── frame-list.js │ │ │ │ │ ├── frame-modal.js │ │ │ │ │ ├── frames.js │ │ │ │ │ ├── history-data.js │ │ │ │ │ ├── iframes.js │ │ │ │ │ ├── image-view.js │ │ │ │ │ ├── index.js │ │ │ │ │ ├── inspectors.js │ │ │ │ │ ├── is-utf8.js │ │ │ │ │ ├── json-dialog.js │ │ │ │ │ ├── json-viewer.js │ │ │ │ │ ├── kv-dialog.js │ │ │ │ │ ├── list-dialog.js │ │ │ │ │ ├── list-modal.js │ │ │ │ │ ├── list.js │ │ │ │ │ ├── menu-item.js │ │ │ │ │ ├── message.js │ │ │ │ │ ├── modal.js │ │ │ │ │ ├── network-modal.js │ │ │ │ │ ├── network-settings.js │ │ │ │ │ ├── network.js │ │ │ │ │ ├── online.js │ │ │ │ │ ├── overview.js │ │ │ │ │ ├── plugins.js │ │ │ │ │ ├── properties.js │ │ │ │ │ ├── props-editor.js │ │ │ │ │ ├── protocols.js │ │ │ │ │ ├── qrcode-dialog.js │ │ │ │ │ ├── record-btn.js │ │ │ │ │ ├── recycle-bin.js │ │ │ │ │ ├── req-data.js │ │ │ │ │ ├── req-detail.js │ │ │ │ │ ├── res-detail.js │ │ │ │ │ ├── rules-hint.js │ │ │ │ │ ├── rules-mode.js │ │ │ │ │ ├── server-log.js │ │ │ │ │ ├── storage.js │ │ │ │ │ ├── sync-dialog.js │ │ │ │ │ ├── table.js │ │ │ │ │ ├── text-dialog.js │ │ │ │ │ ├── textarea.js │ │ │ │ │ ├── textview.js │ │ │ │ │ ├── timeline.js │ │ │ │ │ ├── tool-box.js │ │ │ │ │ ├── tools.js │ │ │ │ │ ├── update-all-btn.js │ │ │ │ │ └── util.js │ │ │ │ │ └── webpack.config.js │ │ │ └── lib │ │ │ │ ├── index.js │ │ │ │ └── proxy.js │ │ └── weinre.js │ ├── docs │ │ ├── LANGS.md │ │ ├── assets │ │ │ ├── host01.png │ │ │ ├── host02.png │ │ │ └── whistle-en_US.png │ │ ├── en │ │ │ ├── README.md │ │ │ ├── SUMMARY.md │ │ │ ├── feedback.md │ │ │ ├── gitbook │ │ │ │ └── images │ │ │ │ │ ├── apple-touch-icon-precomposed-152.png │ │ │ │ │ └── favicon.ico │ │ │ ├── img │ │ │ │ ├── Android_proxy.png │ │ │ │ ├── composer.gif │ │ │ │ ├── firefox-proxy-1.jpg │ │ │ │ ├── firefox-proxy-2.jpg │ │ │ │ ├── https.gif │ │ │ │ ├── iOS-proxy-all.jpg │ │ │ │ ├── iOS-proxy.jpg │ │ │ │ ├── iOS_proxy.PNG │ │ │ │ ├── iOS_proxy_settings.png │ │ │ │ ├── ios10.3_ca.PNG │ │ │ │ ├── linux-proxy-1.jpg │ │ │ │ ├── linux-proxy-2.jpg │ │ │ │ ├── log.gif │ │ │ │ ├── mac-proxy-1.jpg │ │ │ │ ├── mac-proxy-2.jpg │ │ │ │ ├── network.gif │ │ │ │ ├── online.gif │ │ │ │ ├── plugins.gif │ │ │ │ ├── rules.gif │ │ │ │ ├── seq.png │ │ │ │ ├── settings.png │ │ │ │ ├── start_w2.jpg │ │ │ │ ├── switchyomega.jpg │ │ │ │ ├── values.gif │ │ │ │ ├── weinre.gif │ │ │ │ └── windows_rootca.jpeg │ │ │ ├── proxy-setting.md │ │ │ ├── rules │ │ │ │ ├── README.md │ │ │ │ ├── accept.md │ │ │ │ ├── attachment.md │ │ │ │ ├── auth.md │ │ │ │ ├── cache.md │ │ │ │ ├── css.md │ │ │ │ ├── cssAppend.md │ │ │ │ ├── cssBody.md │ │ │ │ ├── cssPrepend.md │ │ │ │ ├── delete.md │ │ │ │ ├── disable.md │ │ │ │ ├── dispatch.md │ │ │ │ ├── enable.md │ │ │ │ ├── etag.md │ │ │ │ ├── filter.md │ │ │ │ ├── forwardedFor.md │ │ │ │ ├── host.md │ │ │ │ ├── hostname.md │ │ │ │ ├── html.md │ │ │ │ ├── htmlAppend.md │ │ │ │ ├── htmlBody.md │ │ │ │ ├── htmlPrepend.md │ │ │ │ ├── ignore.md │ │ │ │ ├── js.md │ │ │ │ ├── jsAppend.md │ │ │ │ ├── jsBody.md │ │ │ │ ├── jsPrepend.md │ │ │ │ ├── log.md │ │ │ │ ├── method.md │ │ │ │ ├── pac.md │ │ │ │ ├── params.md │ │ │ │ ├── plugin.md │ │ │ │ ├── proxy.md │ │ │ │ ├── redirect.md │ │ │ │ ├── referer.md │ │ │ │ ├── replaceStatus.md │ │ │ │ ├── req.md │ │ │ │ ├── reqAppend.md │ │ │ │ ├── reqBody.md │ │ │ │ ├── reqCharset.md │ │ │ │ ├── reqCookies.md │ │ │ │ ├── reqCors.md │ │ │ │ ├── reqDelay.md │ │ │ │ ├── reqHeaders.md │ │ │ │ ├── reqPrepend.md │ │ │ │ ├── reqReplace.md │ │ │ │ ├── reqScript.md │ │ │ │ ├── reqSpeed.md │ │ │ │ ├── reqType.md │ │ │ │ ├── reqWrite.md │ │ │ │ ├── reqWriteRaw.md │ │ │ │ ├── res.md │ │ │ │ ├── resAppend.md │ │ │ │ ├── resBody.md │ │ │ │ ├── resCharset.md │ │ │ │ ├── resCookies.md │ │ │ │ ├── resCors.md │ │ │ │ ├── resDelay.md │ │ │ │ ├── resHeaders.md │ │ │ │ ├── resPrepend.md │ │ │ │ ├── resReplace.md │ │ │ │ ├── resScript.md │ │ │ │ ├── resSpeed.md │ │ │ │ ├── resType.md │ │ │ │ ├── resWrite.md │ │ │ │ ├── resWriteRaw.md │ │ │ │ ├── responseFor.md │ │ │ │ ├── rule │ │ │ │ │ ├── README.md │ │ │ │ │ ├── custom.md │ │ │ │ │ ├── file.md │ │ │ │ │ ├── rawfile.md │ │ │ │ │ ├── replace.md │ │ │ │ │ ├── tpl.md │ │ │ │ │ ├── xfile.md │ │ │ │ │ ├── xrawfile.md │ │ │ │ │ └── xtpl.md │ │ │ │ ├── rulesFile.md │ │ │ │ ├── socks.md │ │ │ │ ├── statusCode.md │ │ │ │ ├── ua.md │ │ │ │ ├── urlParams.md │ │ │ │ ├── urlReplace.md │ │ │ │ └── weinre.md │ │ │ └── webui │ │ │ │ └── https.md │ │ ├── new-docs │ │ │ ├── .vuepress │ │ │ │ ├── config.js │ │ │ │ └── public │ │ │ │ │ ├── favicon.ico │ │ │ │ │ └── host01.png │ │ │ ├── README.md │ │ │ ├── assets │ │ │ │ ├── download-rootca.jpg │ │ │ │ ├── proxy-mac.jpg │ │ │ │ └── trust-mac-rootca.jpg │ │ │ ├── en │ │ │ │ ├── README.md │ │ │ │ ├── cli.md │ │ │ │ ├── custom.md │ │ │ │ ├── examples │ │ │ │ │ └── README.md │ │ │ │ ├── faq.md │ │ │ │ ├── getting-started.md │ │ │ │ ├── home.md │ │ │ │ ├── installation.md │ │ │ │ ├── introduction.md │ │ │ │ ├── protocols │ │ │ │ │ ├── README.md │ │ │ │ │ ├── host.md │ │ │ │ │ └── rule │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ └── file.md │ │ │ │ ├── rule-introduction.md │ │ │ │ └── ui-operation.md │ │ │ └── zh │ │ │ │ ├── README.md │ │ │ │ ├── cli.md │ │ │ │ ├── custom.md │ │ │ │ ├── examples │ │ │ │ └── README.md │ │ │ │ ├── faq.md │ │ │ │ ├── getting-started.md │ │ │ │ ├── installation.md │ │ │ │ ├── introduction.md │ │ │ │ ├── protocols │ │ │ │ ├── README.md │ │ │ │ ├── host.md │ │ │ │ └── rule │ │ │ │ │ ├── README.md │ │ │ │ │ └── file.md │ │ │ │ ├── rule-introduction.md │ │ │ │ └── ui-operation.md │ │ ├── script │ │ │ ├── build-book.sh │ │ │ ├── config.js │ │ │ ├── config.json │ │ │ ├── correct-anchor.js │ │ │ ├── docify.js │ │ │ └── how-to-write.md │ │ └── zh │ │ │ ├── README.md │ │ │ ├── SUMMARY.md │ │ │ ├── attention.md │ │ │ ├── cases.md │ │ │ ├── cli.md │ │ │ ├── custom-certs.md │ │ │ ├── data.md │ │ │ ├── feedback.md │ │ │ ├── frequet.md │ │ │ ├── gitbook │ │ │ └── images │ │ │ │ ├── apple-touch-icon-precomposed-152.png │ │ │ │ └── favicon.ico │ │ │ ├── img │ │ │ ├── Android_proxy.png │ │ │ ├── composer.gif │ │ │ ├── firefox-proxy-1.jpg │ │ │ ├── firefox-proxy-2.jpg │ │ │ ├── host01.png │ │ │ ├── host02.png │ │ │ ├── http-request.png │ │ │ ├── https.gif │ │ │ ├── iOS-proxy-all.jpg │ │ │ ├── iOS-proxy.jpg │ │ │ ├── iOS_proxy.PNG │ │ │ ├── iOS_proxy_settings.png │ │ │ ├── ios10.3_ca.PNG │ │ │ ├── linux-proxy-1.jpg │ │ │ ├── linux-proxy-2.jpg │ │ │ ├── log-basic.gif │ │ │ ├── log-switch.gif │ │ │ ├── mac-proxy-1.jpg │ │ │ ├── mac-proxy-2.jpg │ │ │ ├── network.gif │ │ │ ├── online.gif │ │ │ ├── plugin-list.png │ │ │ ├── plugin1.png │ │ │ ├── plugin2.png │ │ │ ├── plugin3.png │ │ │ ├── plugins.gif │ │ │ ├── rules.gif │ │ │ ├── seq.png │ │ │ ├── settings.png │ │ │ ├── start_w2.jpg │ │ │ ├── switchyomega.jpg │ │ │ ├── tunnel-request.png │ │ │ ├── values.gif │ │ │ ├── weinre.gif │ │ │ └── windows_rootca.jpeg │ │ │ ├── install.md │ │ │ ├── mode.md │ │ │ ├── options.md │ │ │ ├── pattern.md │ │ │ ├── plugins.md │ │ │ ├── principle.md │ │ │ ├── questions.md │ │ │ ├── quickstart.md │ │ │ ├── rules │ │ │ ├── @.md │ │ │ ├── README.md │ │ │ ├── accept.md │ │ │ ├── attachment.md │ │ │ ├── auth.md │ │ │ ├── cache.md │ │ │ ├── cipher.md │ │ │ ├── css.md │ │ │ ├── cssAppend.md │ │ │ ├── cssBody.md │ │ │ ├── cssPrepend.md │ │ │ ├── delete.md │ │ │ ├── disable.md │ │ │ ├── dispatch.md │ │ │ ├── enable.md │ │ │ ├── etag.md │ │ │ ├── filter.md │ │ │ ├── forwardedFor.md │ │ │ ├── headerReplace.md │ │ │ ├── host.md │ │ │ ├── hostname.md │ │ │ ├── html.md │ │ │ ├── htmlAppend.md │ │ │ ├── htmlBody.md │ │ │ ├── htmlPrepend.md │ │ │ ├── http-proxy.md │ │ │ ├── https-proxy.md │ │ │ ├── ignore.md │ │ │ ├── js.md │ │ │ ├── jsAppend.md │ │ │ ├── jsBody.md │ │ │ ├── jsPrepend.md │ │ │ ├── lineProps.md │ │ │ ├── location.md │ │ │ ├── log.md │ │ │ ├── method.md │ │ │ ├── pac.md │ │ │ ├── params.md │ │ │ ├── pathReplace.md │ │ │ ├── pipe.md │ │ │ ├── plugin.md │ │ │ ├── proxy.md │ │ │ ├── redirect.md │ │ │ ├── referer.md │ │ │ ├── replaceStatus.md │ │ │ ├── req.md │ │ │ ├── reqAppend.md │ │ │ ├── reqBody.md │ │ │ ├── reqCharset.md │ │ │ ├── reqCookies.md │ │ │ ├── reqCors.md │ │ │ ├── reqDelay.md │ │ │ ├── reqHeaders.md │ │ │ ├── reqMerge.md │ │ │ ├── reqPrepend.md │ │ │ ├── reqReplace.md │ │ │ ├── reqScript.md │ │ │ ├── reqSpeed.md │ │ │ ├── reqType.md │ │ │ ├── reqWrite.md │ │ │ ├── reqWriteRaw.md │ │ │ ├── res.md │ │ │ ├── resAppend.md │ │ │ ├── resBody.md │ │ │ ├── resCharset.md │ │ │ ├── resCookies.md │ │ │ ├── resCors.md │ │ │ ├── resDelay.md │ │ │ ├── resHeaders.md │ │ │ ├── resMerge.md │ │ │ ├── resPrepend.md │ │ │ ├── resReplace.md │ │ │ ├── resScript.md │ │ │ ├── resSpeed.md │ │ │ ├── resType.md │ │ │ ├── resWrite.md │ │ │ ├── resWriteRaw.md │ │ │ ├── responseFor.md │ │ │ ├── rule │ │ │ │ ├── README.md │ │ │ │ ├── custom.md │ │ │ │ ├── file.md │ │ │ │ ├── rawfile.md │ │ │ │ ├── replace.md │ │ │ │ ├── statusCode.md │ │ │ │ ├── tpl.md │ │ │ │ ├── xfile.md │ │ │ │ ├── xrawfile.md │ │ │ │ └── xtpl.md │ │ │ ├── rulesFile.md │ │ │ ├── socks.md │ │ │ ├── statusCode.md │ │ │ ├── style.md │ │ │ ├── trailers.md │ │ │ ├── ua.md │ │ │ ├── urlParams.md │ │ │ └── weinre.md │ │ │ ├── update.md │ │ │ └── webui │ │ │ ├── README.md │ │ │ ├── composer.md │ │ │ ├── files.md │ │ │ ├── filter.md │ │ │ ├── https.md │ │ │ ├── log.md │ │ │ ├── network.md │ │ │ ├── online.md │ │ │ ├── plugins.md │ │ │ ├── rules.md │ │ │ ├── settings.md │ │ │ ├── values.md │ │ │ ├── websocket.md │ │ │ └── weinre.md │ ├── index.js │ ├── lib │ │ ├── config.js │ │ ├── handlers │ │ │ ├── error-handler.js │ │ │ ├── file-proxy.js │ │ │ ├── final-handler.js │ │ │ ├── http-proxy.js │ │ │ ├── index.js │ │ │ └── plugin-handler.js │ │ ├── https │ │ │ ├── ca.js │ │ │ ├── h2.js │ │ │ └── index.js │ │ ├── index.js │ │ ├── init.js │ │ ├── inspectors │ │ │ ├── data.js │ │ │ ├── index.js │ │ │ ├── log.js │ │ │ ├── req.js │ │ │ ├── res.js │ │ │ ├── res.js.orig │ │ │ ├── rules.js │ │ │ └── weinre.js │ │ ├── plugins │ │ │ ├── get-plugins-sync.js │ │ │ ├── get-plugins.js │ │ │ ├── index.js │ │ │ ├── load-plugin.js │ │ │ ├── module-paths.js │ │ │ └── util.js │ │ ├── rules │ │ │ ├── dns.js │ │ │ ├── index.js │ │ │ ├── protocols.js │ │ │ ├── recycle-bin.js │ │ │ ├── rules.js │ │ │ ├── storage.js │ │ │ └── util.js │ │ ├── service │ │ │ ├── extract-saz.js │ │ │ ├── generate-saz.js │ │ │ ├── index.js │ │ │ ├── service.js │ │ │ └── util.js │ │ ├── socket-mgr.js │ │ ├── tunnel.js │ │ ├── upgrade.js │ │ └── util │ │ │ ├── buf-util.js │ │ │ ├── common.js │ │ │ ├── data-server.js │ │ │ ├── drain.js │ │ │ ├── file-mgr.js │ │ │ ├── file-writer-transform.js │ │ │ ├── http-mgr.js │ │ │ ├── index.js │ │ │ ├── is-utf8.js │ │ │ ├── log-server.js │ │ │ ├── logger.js │ │ │ ├── parse-query.js │ │ │ ├── parse-url.js │ │ │ ├── patch.js │ │ │ ├── process.js │ │ │ ├── replace-pattern-transform.js │ │ │ ├── replace-string-transform.js │ │ │ ├── speed-transform.js │ │ │ ├── transproto.js │ │ │ ├── whistle-transform.js │ │ │ └── zlib.js │ ├── package-lock.json │ ├── package.json │ └── test │ │ ├── assets │ │ ├── certs │ │ │ ├── _.cert.w2.org.crt │ │ │ ├── _.cert.w2.org.key │ │ │ ├── _root.crt │ │ │ ├── cert.w2.org.key │ │ │ ├── root.key │ │ │ ├── test.crt │ │ │ └── test.key │ │ ├── files │ │ │ ├── 1.txt │ │ │ ├── 2.txt │ │ │ ├── 3.txt │ │ │ ├── empty.txt │ │ │ ├── gb2312.txt │ │ │ ├── rules.txt │ │ │ ├── storage │ │ │ │ ├── .backup │ │ │ │ │ ├── 1.test1.tx │ │ │ │ │ ├── 2.test2.tx │ │ │ │ │ ├── 3.test3.tx │ │ │ │ │ └── properties │ │ │ │ ├── files │ │ │ │ │ ├── 1.test1.tx │ │ │ │ │ ├── 2.test2.tx │ │ │ │ │ └── 3.test3.tx │ │ │ │ └── properties │ │ │ └── test.txt │ │ └── values │ │ │ ├── rawFile.html │ │ │ ├── rawFile2.js │ │ │ ├── reqScript.js │ │ │ ├── resScript.js │ │ │ ├── rulesFile.js │ │ │ ├── rulesFile.txt │ │ │ ├── rulesFile2.js │ │ │ ├── test.json │ │ │ ├── test2.json │ │ │ ├── test3.json │ │ │ ├── tps.rules │ │ │ ├── tps1.json │ │ │ └── tps2.json │ │ ├── config.test.js │ │ ├── events.js │ │ ├── index.test.js │ │ ├── plugins │ │ ├── @test │ │ │ └── whistle.test3 │ │ │ │ ├── index.js │ │ │ │ ├── package.json │ │ │ │ ├── rules.txt │ │ │ │ └── test │ │ │ │ └── abc │ │ │ │ ├── abc │ │ │ │ └── index.html │ │ │ │ └── index.html │ │ ├── whistle.pipe-http │ │ │ ├── index.js │ │ │ ├── lib │ │ │ │ ├── reqReadServer.js │ │ │ │ ├── reqWriteServer.js │ │ │ │ ├── resReadServer.js │ │ │ │ └── resWriteServer.js │ │ │ ├── package.json │ │ │ └── rules.txt │ │ ├── whistle.pipe-tunnel │ │ │ ├── index.js │ │ │ ├── lib │ │ │ │ ├── tunnelReqRead.js │ │ │ │ ├── tunnelReqWrite.js │ │ │ │ ├── tunnelResRead.js │ │ │ │ └── tunnelResWrite.js │ │ │ ├── package.json │ │ │ └── rules.txt │ │ ├── whistle.pipe-ws │ │ │ ├── index.js │ │ │ ├── lib │ │ │ │ ├── wsReqRead.js │ │ │ │ ├── wsReqWrite.js │ │ │ │ ├── wsResRead.js │ │ │ │ └── wsResWrite.js │ │ │ ├── package.json │ │ │ └── rules.txt │ │ ├── whistle.test1 │ │ │ ├── _rules.txt │ │ │ ├── index.js │ │ │ ├── lib │ │ │ │ └── rulesServer.js │ │ │ ├── package.json │ │ │ └── rules.txt │ │ └── whistle.test2 │ │ │ ├── _rules.txt │ │ │ ├── index.js │ │ │ ├── package.json │ │ │ ├── rules.txt │ │ │ └── test.txt │ │ ├── rules.txt │ │ ├── units │ │ ├── _normalizeConnectArgs.test.js │ │ ├── attachment.test.js │ │ ├── auth.test.js │ │ ├── cache.test.js │ │ ├── common.test.js │ │ ├── composer.test.js │ │ ├── connect.test.js │ │ ├── css.test.js │ │ ├── delete.test.js │ │ ├── disable.test.js │ │ ├── file.test.js │ │ ├── filter.test.js │ │ ├── fm.test.js │ │ ├── forward.test.js │ │ ├── host.test.js │ │ ├── html.test.js │ │ ├── https.test.js │ │ ├── ignore.test.js │ │ ├── insertFile.test.js │ │ ├── js.test.js │ │ ├── log.test.js │ │ ├── method.test.js │ │ ├── options.test.js │ │ ├── others.test.js │ │ ├── pac.test.js │ │ ├── params.test.js │ │ ├── plugin.test.js │ │ ├── plugins.test.js │ │ ├── proxy.test.js │ │ ├── range.test.js │ │ ├── rawfile.test.js │ │ ├── redirect.test.js │ │ ├── referer.test.js │ │ ├── replaceStatus.test.js │ │ ├── req.prepend.body.append.test.js │ │ ├── reqAppend.test.js │ │ ├── reqBody.test.js │ │ ├── reqCharset.test.js │ │ ├── reqCookies.test.js │ │ ├── reqCors.test.js │ │ ├── reqDelay.test.js │ │ ├── reqHeaders.test.js │ │ ├── reqPrepend.test.js │ │ ├── reqReplace.test.js │ │ ├── reqSpeed.test.js │ │ ├── reqType.test.js │ │ ├── res.prepend.body.append.test.js │ │ ├── resAppend.test.js │ │ ├── resBody.test.js │ │ ├── resCharset.test.js │ │ ├── resCookies.test.js │ │ ├── resCors.test.js │ │ ├── resDelay.test.js │ │ ├── resHeaders.test.js │ │ ├── resPrepend.test.js │ │ ├── resReplace.test.js │ │ ├── resSpeed.test.js │ │ ├── resType.test.js │ │ ├── rule.test.js │ │ ├── rulesFile.test.js │ │ ├── script.test.js │ │ ├── socks.test.js │ │ ├── ssi-include.test.js │ │ ├── statusCode.test.js │ │ ├── tpl.test.js │ │ ├── tplStr.test.js │ │ ├── tps.test.js │ │ ├── tunnel.test.js │ │ ├── tunnelPolicy.test.js │ │ ├── ua.test.js │ │ ├── ui.test.js │ │ ├── urlParams.test.js │ │ ├── urlReplace.test.js │ │ ├── utils.test.js │ │ ├── values.test.js │ │ ├── var.test.js │ │ ├── weinre.test.js │ │ ├── wildcard.test.js │ │ ├── write.test.js │ │ ├── ws.test.js │ │ └── xfile.test.js │ │ └── util.test.js └── win_proxy_helper │ ├── MConsole.bas │ ├── win_proxy_helper.bas │ ├── win_proxy_helper.vbp │ └── win_proxy_helper.vbw └── webpack ├── webpack.base.config.js ├── webpack.main.config.js ├── webpack.main.prod.config.js ├── webpack.renderer.config.js ├── webpack.renderer.dev.config.js └── webpack.renderer.prod.config.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [["import", { 3 | "libraryName": "antd", 4 | "style": false 5 | } 6 | ]] 7 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | thumbs.db 4 | .idea/ 5 | private 6 | !src/renderer/extensions/whistle 7 | yarn-error.log 8 | whistle.log 9 | !license_third_party/whistle 10 | yarn.lock 11 | 12 | app/dist/ 13 | app/node_modules/ 14 | release/ 15 | docs/.vuepress/dist 16 | .tmp 17 | vendor/files/node/modules 18 | .umi 19 | *.swp 20 | *.zip 21 | 22 | node-mac 23 | node.exe 24 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | electron-mirror=https://npm.taobao.org/mirrors/electron/ 2 | electron-custom-dir=10.1.5 3 | 4 | registry=https://registry.npm.taobao.org 5 | disturl=https://npm.taobao.org/dist 6 | sass_binary_site=https://npm.taobao.org/mirrors/node-sass/ 7 | phantomjs_cdnurl=https://npm.taobao.org/mirrors/phantomjs/ 8 | chromedriver_cdnurl=https://npm.taobao.org/mirrors/chromedriver 9 | operadriver_cdnurl=https://npm.taobao.org/mirrors/operadriver 10 | selenium_cdnurl=https://npm.taobao.org/mirrors/selenium 11 | node_inspector_cdnurl=https://npm.taobao.org/mirrors/node-inspector 12 | fsevents_binary_host_mirror=http://npm.taobao.org/mirrors/fsevents/ 13 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | semi: true, 3 | trailingComma: 'all', 4 | singleQuote: true, 5 | printWidth: 120, 6 | tabWidth: 4, 7 | }; -------------------------------------------------------------------------------- /.yarnclean: -------------------------------------------------------------------------------- 1 | 2 | 3 | # test directories 4 | __tests__ 5 | node_modules/*/test 6 | node_modules/*/tests 7 | powered-test 8 | 9 | # asset directories 10 | docs 11 | doc 12 | website 13 | 14 | # examples 15 | example 16 | examples 17 | 18 | # code coverage directories 19 | coverage 20 | .nyc_output 21 | 22 | # build scripts 23 | Makefile 24 | Gulpfile.js 25 | Gruntfile.js 26 | 27 | # configs 28 | .tern-project 29 | .gitattributes 30 | .editorconfig 31 | .*ignore 32 | .eslintrc 33 | .jshintrc 34 | .flowconfig 35 | .documentup.json 36 | .yarn-metadata.json 37 | 38 | # misc 39 | *.gz 40 | *.md 41 | 42 | -------------------------------------------------------------------------------- /app/main.js: -------------------------------------------------------------------------------- 1 | require('./dist/main.js'); -------------------------------------------------------------------------------- /app/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "LightProxy", 3 | "version": "1.1.41-beta-5", 4 | "lockfileVersion": 1 5 | } 6 | -------------------------------------------------------------------------------- /app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "LightProxy", 3 | "version": "1.1.41-beta-5", 4 | "main": "./dist/main.js", 5 | "__note": "This file is generated by scripts/sync-version.js" 6 | } 7 | -------------------------------------------------------------------------------- /docs/.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | 15 | [Makefile] 16 | indent_style = tab 17 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /npm-debug.log* 6 | /yarn-error.log 7 | /yarn.lock 8 | /package-lock.json 9 | 10 | # production 11 | /dist 12 | 13 | # misc 14 | .DS_Store 15 | 16 | # umi 17 | .umi 18 | .umi-production 19 | .env.local 20 | -------------------------------------------------------------------------------- /docs/.prettierignore: -------------------------------------------------------------------------------- 1 | **/*.svg 2 | **/*.ejs 3 | **/*.html 4 | package.json 5 | .umi 6 | .umi-production 7 | -------------------------------------------------------------------------------- /docs/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "all", 4 | "printWidth": 80, 5 | "overrides": [ 6 | { 7 | "files": ".prettierrc", 8 | "options": { "parser": "json" } 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # dumi app 2 | 3 | ## Getting Started 4 | 5 | Install dependencies, 6 | 7 | ```bash 8 | $ npm i 9 | ``` 10 | 11 | Start the dev server, 12 | 13 | ```bash 14 | $ npm start 15 | ``` 16 | 17 | Build site app, 18 | 19 | ```bash 20 | $ npm run build 21 | ``` 22 | -------------------------------------------------------------------------------- /docs/docs/doc/capture-network.zh-CN.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: '网络抓包' 3 | order: 2 4 | --- 5 | 6 | 在启动 LightProxy 后,系统代理就会被自动设置到 LightProxy 上。 7 | 8 | 9 | 点击主界面的 `Whistle` 标签页就能看到 whistle 提供的抓包界面 10 | 11 | 12 | ![img](../imgs/network-capture.png) 13 | 14 | 15 | 当我们访问 `https://www.bing.com` 时,就能在界面上看到相应的请求细节。 16 | 17 | ## 手机抓包 18 | 19 | 如果需要对手机的网络请求进行抓包,请参考 [无线代理](./wireless) 20 | 21 | 注意:LightProxy 默认不在局域网可见,对手机抓包必须要点一下手机代理 Tab 才会开启局域网可见 22 | -------------------------------------------------------------------------------- /docs/docs/doc/remote-debug.zh-CN.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 远程调试 3 | order: 3 4 | --- 5 | 6 | # 远程调试 7 | 8 | 我们在无线开发的场景下常常要对无线设备的浏览器和 App 端进行调试,有些情况下我们可以借助 Chrome 或者 Safari 的 Remote Debugger 功能,借助 USB 连接线进行调试。 9 | 但是有些场景下我们不具备这样的条件,LightProxy 会借助代理的能力快速注入远程调试的能力。 10 | 11 | 图为在 iOS 的微信 Webview 进行 Debug。 12 | 13 | ![img](../imgs/remote-debug.png) 14 | 15 | ## 使用方式 16 | 17 | 打开 Debugger Tab,然后通过代理访问带有参数 `lightproxy=true` 的页面,就会在该 Tab 看到 inspect 的按钮。 18 | 19 | 如果要调试无线页面,请先保证手机已经正确设置代理。 20 | -------------------------------------------------------------------------------- /docs/docs/imgs/add-btn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/docs/docs/imgs/add-btn.png -------------------------------------------------------------------------------- /docs/docs/imgs/check-status.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/docs/docs/imgs/check-status.png -------------------------------------------------------------------------------- /docs/docs/imgs/devtools.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/docs/docs/imgs/devtools.png -------------------------------------------------------------------------------- /docs/docs/imgs/group-dingtalk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/docs/docs/imgs/group-dingtalk.png -------------------------------------------------------------------------------- /docs/docs/imgs/install.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/docs/docs/imgs/install.png -------------------------------------------------------------------------------- /docs/docs/imgs/ios-install-cert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/docs/docs/imgs/ios-install-cert.png -------------------------------------------------------------------------------- /docs/docs/imgs/ios-scan-qr.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/docs/docs/imgs/ios-scan-qr.jpeg -------------------------------------------------------------------------------- /docs/docs/imgs/ios-settings.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/docs/docs/imgs/ios-settings.jpeg -------------------------------------------------------------------------------- /docs/docs/imgs/ios-trust-cert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/docs/docs/imgs/ios-trust-cert.png -------------------------------------------------------------------------------- /docs/docs/imgs/ios-wifi-settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/docs/docs/imgs/ios-wifi-settings.png -------------------------------------------------------------------------------- /docs/docs/imgs/menubar-copy-shell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/docs/docs/imgs/menubar-copy-shell.png -------------------------------------------------------------------------------- /docs/docs/imgs/mock-json-result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/docs/docs/imgs/mock-json-result.png -------------------------------------------------------------------------------- /docs/docs/imgs/mock-json.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/docs/docs/imgs/mock-json.png -------------------------------------------------------------------------------- /docs/docs/imgs/network-capture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/docs/docs/imgs/network-capture.png -------------------------------------------------------------------------------- /docs/docs/imgs/preview-network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/docs/docs/imgs/preview-network.png -------------------------------------------------------------------------------- /docs/docs/imgs/preview-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/docs/docs/imgs/preview-new.png -------------------------------------------------------------------------------- /docs/docs/imgs/quick-rule-nodejs-result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/docs/docs/imgs/quick-rule-nodejs-result.png -------------------------------------------------------------------------------- /docs/docs/imgs/quick-rule-nodejs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/docs/docs/imgs/quick-rule-nodejs.png -------------------------------------------------------------------------------- /docs/docs/imgs/quick-rule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/docs/docs/imgs/quick-rule.png -------------------------------------------------------------------------------- /docs/docs/imgs/remote-debug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/docs/docs/imgs/remote-debug.png -------------------------------------------------------------------------------- /docs/docs/imgs/security-open-anyway.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/docs/docs/imgs/security-open-anyway.png -------------------------------------------------------------------------------- /docs/docs/imgs/use-with-umi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/docs/docs/imgs/use-with-umi.png -------------------------------------------------------------------------------- /docs/docs/imgs/wireless-tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/docs/docs/imgs/wireless-tab.png -------------------------------------------------------------------------------- /docs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "module": "esnext", 5 | "moduleResolution": "node", 6 | "importHelpers": true, 7 | "jsx": "react", 8 | "esModuleInterop": true, 9 | "sourceMap": true, 10 | "baseUrl": "./", 11 | "strict": true, 12 | "paths": { 13 | "@/*": ["src/*"], 14 | "@@/*": ["src/.umi/*"] 15 | }, 16 | "allowSyntheticDefaultImports": true 17 | }, 18 | "exclude": ["node_modules", "dist", "typings"] 19 | } 20 | -------------------------------------------------------------------------------- /docs/typings.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.css'; 2 | declare module '*.less'; 3 | -------------------------------------------------------------------------------- /scripts/sync-version.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | 4 | const packageJSON = JSON.parse(fs.readFileSync(path.join(__dirname, '../package.json'), 'utf-8')); 5 | 6 | const appJSON = { 7 | "name": packageJSON.name, 8 | "version": packageJSON.version, 9 | "main": packageJSON.main, 10 | "__note": "This file is generated by scripts/sync-version.js", 11 | }; 12 | 13 | fs.writeFileSync(path.join(__dirname, '../app/package.json'), JSON.stringify(appJSON), 'utf-8'); 14 | console.log('generate app/package.json'); 15 | -------------------------------------------------------------------------------- /scripts/update-node.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | const os = require('os'); 4 | const shell = require('shelljs'); 5 | 6 | const systemType = os.type(); 7 | const SYSTEM_IS_MACOS = systemType === 'Darwin'; 8 | 9 | if (SYSTEM_IS_MACOS) { 10 | shell.exec(`cd vendor/files/node && curl https://cdn.npm.taobao.org/dist/node/v15.12.0/node-v15.12.0-darwin-x64.tar.gz| tar -xz && mv node-*-darwin-x64/bin/node node-mac && rm -rf node-*-darwin-x64`); 11 | } else { 12 | shell.exec(`cd vendor/files/node && curl https://cdn.npm.taobao.org/dist/node/v14.15.3/win-x86/node.exe > node-win.exe`) 13 | } 14 | -------------------------------------------------------------------------------- /src/index.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | LightProxy 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/switch-entry.ts: -------------------------------------------------------------------------------- 1 | require('./main'); 2 | -------------------------------------------------------------------------------- /src/renderer/components/index.less: -------------------------------------------------------------------------------- 1 | @import "./app/index.less"; -------------------------------------------------------------------------------- /src/renderer/components/status-bar/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | 3 | interface Props { 4 | rightItems: Function[]; 5 | } 6 | 7 | export const StatusBar = (props: Props) => { 8 | const { rightItems } = props; 9 | const [color, setColor] = useState('normal'); 10 | return ( 11 |
12 | {rightItems.map((item, index) => { 13 | const Comp = item; 14 | return ; 15 | })} 16 |
17 | ); 18 | }; 19 | -------------------------------------------------------------------------------- /src/renderer/extensions/rule-editor/components/card/index.less: -------------------------------------------------------------------------------- 1 | .lightproxy-select-item { 2 | padding: 5px 10px 5px 10px; 3 | } 4 | 5 | .lightproxy-select-icon { 6 | display: inline-block; 7 | } 8 | 9 | .lightproxy-select-title { 10 | display: inline-block; 11 | padding-left: 20px; 12 | } 13 | 14 | .lightproxy-card { 15 | .ant-select-selection { 16 | border: none !important; 17 | font-size: 10px !important; 18 | } 19 | } -------------------------------------------------------------------------------- /src/renderer/extensions/rule-editor/index.less: -------------------------------------------------------------------------------- 1 | @import "./components/card/index.less"; 2 | @import "./components/editor/index.less"; 3 | @import "./components/rule-list/index.less"; 4 | 5 | -------------------------------------------------------------------------------- /src/renderer/extensions/setting/components/setting-form/index.less: -------------------------------------------------------------------------------- 1 | .action-btn { 2 | margin-right: 10px; 3 | } -------------------------------------------------------------------------------- /src/renderer/extensions/setting/index.less: -------------------------------------------------------------------------------- 1 | .lightproxy-setting { 2 | padding: 50px; 3 | margin-top: 30px; 4 | line-height: 25px; 5 | font-weight: bold; 6 | font-size: 16px; 7 | color: @font-color; 8 | overflow-y: scroll; 9 | height: 100%; 10 | } 11 | -------------------------------------------------------------------------------- /src/renderer/extensions/weinre/index.less: -------------------------------------------------------------------------------- 1 | .lightproxy-network-panel { 2 | height: 100%; 3 | width: 100%; 4 | margin-top: 30px; 5 | 6 | .lightproxy-network-iframe { 7 | width: 100%; 8 | height: calc(100% - 30px); 9 | } 10 | 11 | .lightproxy-tip { 12 | padding: 50px; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/renderer/extensions/whistle-panel/index.less: -------------------------------------------------------------------------------- 1 | .lightproxy-network-panel { 2 | height: 100%; 3 | width: 100%; 4 | margin-top: 30px; 5 | 6 | 7 | .lightproxy-tip { 8 | padding: 50px; 9 | } 10 | } 11 | 12 | 13 | .lightproxy-network-iframe { 14 | width: calc(100% - 70px); 15 | height: calc(100% - 60px); 16 | position: absolute; 17 | top: 28px; 18 | left: 0px; 19 | } -------------------------------------------------------------------------------- /src/renderer/extensions/whistle/index.less: -------------------------------------------------------------------------------- 1 | .whistle-status-bar-item > * { 2 | vertical-align: middle; 3 | } 4 | -------------------------------------------------------------------------------- /src/renderer/hooks/use-current-window.ts: -------------------------------------------------------------------------------- 1 | import React, { useState, useEffect } from 'react'; 2 | import { remote } from 'electron'; 3 | 4 | function useCurrentWindow() { 5 | const currentWindow = remote.getCurrentWindow(); 6 | 7 | const close = () => currentWindow.hide(); 8 | const minimize = () => currentWindow.minimize(); 9 | const maximize = () => currentWindow.maximize(); 10 | const fullScreen = () => currentWindow.setFullScreen(!currentWindow.isFullScreen()); 11 | 12 | return { 13 | current: currentWindow, 14 | close, 15 | minimize, 16 | maximize, 17 | fullScreen, 18 | }; 19 | } 20 | 21 | export default useCurrentWindow; 22 | -------------------------------------------------------------------------------- /src/renderer/style/theme/base.less: -------------------------------------------------------------------------------- 1 | @import "../../extensions/rule-editor/index.less"; 2 | @import "../../extensions/setting/index.less"; 3 | @import "../../extensions/whistle/index.less"; 4 | @import "../../extensions/whistle-panel/index.less"; 5 | @import "../../extensions/phone-proxy/index.less"; 6 | @import "../../components/index.less"; 7 | @import '~antd/dist/antd.less'; 8 | 9 | -------------------------------------------------------------------------------- /vendor/build/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/build/icon.icns -------------------------------------------------------------------------------- /vendor/files/icon-pure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/files/icon-pure.png -------------------------------------------------------------------------------- /vendor/files/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/files/icon.icns -------------------------------------------------------------------------------- /vendor/files/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/files/icon.ico -------------------------------------------------------------------------------- /vendor/files/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/files/icon.png -------------------------------------------------------------------------------- /vendor/files/iconTemplate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/files/iconTemplate.png -------------------------------------------------------------------------------- /vendor/files/iconTemplate@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/files/iconTemplate@2x.png -------------------------------------------------------------------------------- /vendor/files/node/.yarnclean: -------------------------------------------------------------------------------- 1 | 2 | 3 | # test directories 4 | __tests__ 5 | node_modules/*/test 6 | node_modules/*/tests 7 | powered-test 8 | 9 | # asset directories 10 | docs 11 | doc 12 | website 13 | 14 | # examples 15 | example 16 | examples 17 | 18 | # code coverage directories 19 | coverage 20 | .nyc_output 21 | 22 | # build scripts 23 | Makefile 24 | Gulpfile.js 25 | Gruntfile.js 26 | 27 | # configs 28 | .tern-project 29 | .gitattributes 30 | .editorconfig 31 | .*ignore 32 | .eslintrc 33 | .jshintrc 34 | .flowconfig 35 | .documentup.json 36 | .yarn-metadata.json 37 | 38 | # misc 39 | *.gz 40 | *.md 41 | 42 | -------------------------------------------------------------------------------- /vendor/files/node/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "whistle": "../../whistle", 4 | "whistle-start": "../../whistle-start", 5 | "whistle.chii-internal": "../../whistle.chii-internal", 6 | "whistle.scriptfile": "../../whistle.scriptfile", 7 | "whistle.vase": "^1.3.1" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /vendor/files/proxy_conf_helper: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/files/proxy_conf_helper -------------------------------------------------------------------------------- /vendor/files/win_proxy_helper.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/files/win_proxy_helper.exe -------------------------------------------------------------------------------- /vendor/proxy_conf_helper/BRLOptionParser/.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | xcuserdata/ 3 | build/ 4 | 5 | # CocoaPods 6 | Pods 7 | Podfile.lock 8 | 9 | # OS X 10 | .DS_Store 11 | 12 | -------------------------------------------------------------------------------- /vendor/proxy_conf_helper/BRLOptionParser/.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | before_install: 3 | - gem install cocoapods --no-document --quiet 4 | script: make test 5 | 6 | -------------------------------------------------------------------------------- /vendor/proxy_conf_helper/BRLOptionParser/BRLOptionParser.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /vendor/proxy_conf_helper/BRLOptionParser/BRLOptionParser.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/proxy_conf_helper/BRLOptionParser/BRLOptionParser.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /vendor/proxy_conf_helper/BRLOptionParser/Makefile: -------------------------------------------------------------------------------- 1 | COCOAPODS = Pods Podfile.lock 2 | 3 | default: test 4 | 5 | install: $(COCOAPODS) 6 | 7 | test: install 8 | @xcodebuild \ 9 | -workspace BRLOptionParser.xcworkspace \ 10 | -scheme BRLOptionParser \ 11 | -sdk macosx \ 12 | -configuration Release \ 13 | build test 14 | 15 | $(COCOAPODS): 16 | @pod install 17 | 18 | .PHONY: test 19 | 20 | -------------------------------------------------------------------------------- /vendor/proxy_conf_helper/BRLOptionParser/Podfile: -------------------------------------------------------------------------------- 1 | target 'BRLOptionParserTests' do 2 | pod 'Kiwi' 3 | end 4 | 5 | -------------------------------------------------------------------------------- /vendor/proxy_conf_helper/build.sh: -------------------------------------------------------------------------------- 1 | clang ./main.m -O3 -fobjc-arc -fmodules -mmacosx-version-min=10.10 -o ../files/proxy_conf_helper -------------------------------------------------------------------------------- /vendor/static/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/static/icon.icns -------------------------------------------------------------------------------- /vendor/static/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/static/icon.png -------------------------------------------------------------------------------- /vendor/whistle-start/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "whistle-start", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "glob": "^7.1.6", 13 | "portfinder": "^1.0.26", 14 | "whistle.vase": "^1.2.1", 15 | "ws": "^7.2.1" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vendor/whistle.chii-internal/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | parser: 'babel-eslint', 3 | env: { 4 | commonjs: true, 5 | es6: true, 6 | node: true, 7 | }, 8 | extends: 'eslint:recommended', 9 | }; 10 | -------------------------------------------------------------------------------- /vendor/whistle.chii-internal/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | scripts/ -------------------------------------------------------------------------------- /vendor/whistle.chii-internal/.npmignore: -------------------------------------------------------------------------------- 1 | .gitignore 2 | .eslintrc.js 3 | .travis.yml 4 | prettier.config.js 5 | scripts/ 6 | docs/ -------------------------------------------------------------------------------- /vendor/whistle.chii-internal/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "10" 4 | script: 5 | - npm run ci -------------------------------------------------------------------------------- /vendor/whistle.chii-internal/index.js: -------------------------------------------------------------------------------- 1 | exports.uiServer = require('./lib/uiServer'); 2 | -------------------------------------------------------------------------------- /vendor/whistle.chii-internal/lib/uiServer.js: -------------------------------------------------------------------------------- 1 | const chii = require('chii'); 2 | 3 | module.exports = function (server, options) { 4 | chii.start({ 5 | server, 6 | domain: '127.0.0.1:' + options.config.port + '/whistle.chii-internal', 7 | }); 8 | }; 9 | -------------------------------------------------------------------------------- /vendor/whistle.chii-internal/prettier.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | singleQuote: true, 3 | }; 4 | -------------------------------------------------------------------------------- /vendor/whistle.scriptfile/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "react" 4 | ] 5 | } -------------------------------------------------------------------------------- /vendor/whistle.scriptfile/.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | end_of_line = lf 7 | indent_size = 2 8 | indent_style = space 9 | insert_final_newline = true 10 | max_line_length = 80 11 | trim_trailing_whitespace = true 12 | 13 | [*.md] 14 | max_line_length = 0 15 | trim_trailing_whitespace = false 16 | 17 | [COMMIT_EDITMSG] 18 | max_line_length = 0 -------------------------------------------------------------------------------- /vendor/whistle.scriptfile/.eslintrc: -------------------------------------------------------------------------------- 1 | { "extends": "eslint-config-imweb" } 2 | -------------------------------------------------------------------------------- /vendor/whistle.scriptfile/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./lib'); 2 | -------------------------------------------------------------------------------- /vendor/whistle.scriptfile/lib/dataSource.js: -------------------------------------------------------------------------------- 1 | const { EventEmitter } = require('events'); 2 | 3 | const dataSource = new EventEmitter(); 4 | dataSource.setMaxListeners(1000); 5 | 6 | module.exports = dataSource; 7 | -------------------------------------------------------------------------------- /vendor/whistle.scriptfile/lib/resRulesServer.js: -------------------------------------------------------------------------------- 1 | const Koa = require('koa'); 2 | const co = require('co'); 3 | const util = require('./util'); 4 | const scripts = require('./scripts'); 5 | 6 | module.exports = (server, options) => { 7 | const app = new Koa(); 8 | app.use(function* () { 9 | util.setupContext(this, options); 10 | const { handleResponseRules } = scripts.getHandler(this); 11 | if (util.isFunction(handleResponseRules)) { 12 | yield co.wrap(handleResponseRules)(this); 13 | util.responseRules(this); 14 | } 15 | }); 16 | server.on('request', app.callback()); 17 | }; 18 | -------------------------------------------------------------------------------- /vendor/whistle.scriptfile/lib/tunnelRulesServer.js: -------------------------------------------------------------------------------- 1 | const Koa = require('koa'); 2 | const co = require('co'); 3 | const util = require('./util'); 4 | const scripts = require('./scripts'); 5 | 6 | module.exports = (server, options) => { 7 | const app = new Koa(); 8 | app.use(function* () { 9 | util.setupContext(this, options); 10 | const { handleTunnelRules } = scripts.getHandler(this); 11 | if (util.isFunction(handleTunnelRules)) { 12 | yield co.wrap(handleTunnelRules)(this); 13 | util.responseRules(this); 14 | } 15 | }); 16 | server.on('request', app.callback()); 17 | }; 18 | -------------------------------------------------------------------------------- /vendor/whistle.scriptfile/lib/uiServer/cgi-bin/active.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = function () { 3 | const { name } = this.request.body; 4 | if (name && typeof name === 'string') { 5 | this.storage.setProperty('activeName', name); 6 | } 7 | this.body = { ec: 0 }; 8 | }; 9 | -------------------------------------------------------------------------------- /vendor/whistle.scriptfile/lib/uiServer/cgi-bin/create.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = function () { 3 | const { name, value } = this.request.body; 4 | if (name && typeof name === 'string') { 5 | this.storage.writeFile(name, value); 6 | this.scripts.set(name, value); 7 | } 8 | this.body = { ec: 0 }; 9 | }; 10 | -------------------------------------------------------------------------------- /vendor/whistle.scriptfile/lib/uiServer/cgi-bin/delete.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = function () { 3 | const { name } = this.request.body; 4 | if (name && typeof name === 'string') { 5 | this.storage.removeFile(name); 6 | this.scripts.remove(name); 7 | } 8 | this.body = { ec: 0 }; 9 | }; 10 | -------------------------------------------------------------------------------- /vendor/whistle.scriptfile/lib/uiServer/cgi-bin/emitData.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-empty */ 2 | module.exports = function () { 3 | let { type, args } = this.request.body; 4 | if (args && type && typeof type === 'string') { 5 | try { 6 | args = JSON.parse(args); 7 | if (Array.isArray(args)) { 8 | const { dataSource } = this; 9 | dataSource.emit('data', type, args); 10 | } 11 | } catch (e) {} 12 | } 13 | this.body = { ec: 0 }; 14 | }; 15 | -------------------------------------------------------------------------------- /vendor/whistle.scriptfile/lib/uiServer/cgi-bin/init.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = function () { 3 | const { storage } = this; 4 | /* eslint-disable prefer-arrow-callback */ 5 | this.body = { 6 | list: storage.getFileList().map((item) => { 7 | return { name: item.name, value: item.data }; 8 | }), 9 | activeName: storage.getProperty('activeName'), 10 | fontSize: storage.getProperty('fontSize'), 11 | showLineNumbers: storage.getProperty('showLineNumbers') !== false, 12 | theme: storage.getProperty('theme'), 13 | }; 14 | }; 15 | -------------------------------------------------------------------------------- /vendor/whistle.scriptfile/lib/uiServer/cgi-bin/log.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = function () { 3 | this.body = this.getLogs(this.request.query.id); 4 | }; 5 | -------------------------------------------------------------------------------- /vendor/whistle.scriptfile/lib/uiServer/cgi-bin/rename.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = function () { 3 | const { name, newName } = this.request.body; 4 | if (name && newName) { 5 | this.storage.renameFile(name, newName); 6 | this.scripts.set(newName, this.scripts.get(name)); 7 | this.scripts.remove(name); 8 | } 9 | this.body = { ec: 0 }; 10 | }; 11 | -------------------------------------------------------------------------------- /vendor/whistle.scriptfile/lib/uiServer/cgi-bin/setFontSize.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = function () { 3 | const { fontSize } = this.request.body; 4 | if (fontSize && typeof fontSize === 'string') { 5 | this.storage.setProperty('fontSize', fontSize); 6 | } 7 | this.body = { ec: 0 }; 8 | }; 9 | -------------------------------------------------------------------------------- /vendor/whistle.scriptfile/lib/uiServer/cgi-bin/setTheme.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = function () { 3 | const { theme } = this.request.body; 4 | if (theme && typeof theme === 'string') { 5 | this.storage.setProperty('theme', theme); 6 | } 7 | this.body = { ec: 0 }; 8 | }; 9 | -------------------------------------------------------------------------------- /vendor/whistle.scriptfile/lib/uiServer/cgi-bin/showLineNumbers.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = function () { 3 | const { showLineNumbers } = this.request.body; 4 | this.storage.setProperty('showLineNumbers', showLineNumbers === '1'); 5 | this.body = { ec: 0 }; 6 | }; 7 | -------------------------------------------------------------------------------- /vendor/whistle.scriptfile/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Extension Script For Whistle 7 | 8 | 9 |
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /vendor/whistle.scriptfile/src/css/editor-settings.css: -------------------------------------------------------------------------------- 1 | .w-editor-settings label, .w-editor-settings-box label {font-weight: normal; white-space: nowrap;} 2 | .w-editor-settings label .w-label {display: inline-block; width: 60px; text-align: right;} 3 | .w-editor-settings select {width: 186px;} 4 | .w-editor-settings-box {padding-left: 65px; margin: 5px;} 5 | .w-editor-settings .form-control {display: inline-block; margin-left: 5px;} 6 | .w-editor-settings p {margin: 5px;} -------------------------------------------------------------------------------- /vendor/whistle.scriptfile/src/css/editor.css: -------------------------------------------------------------------------------- 1 | .w-editor {} -------------------------------------------------------------------------------- /vendor/whistle.scriptfile/src/css/filter-input.css: -------------------------------------------------------------------------------- 1 | .w-filter-con {position: relative;} 2 | .w-filter-con .close {position: absolute; right: 5px; top: 5px; color: #fff; line-height: 16px; display: none;} -------------------------------------------------------------------------------- /vendor/whistle.scriptfile/src/css/menu-item.css: -------------------------------------------------------------------------------- 1 | .w-menu-item {position: absolute; background: #fff; border: 1px solid #ccc; z-index: 1001; top: 29px; border-radius: 2px; outline: none;} 2 | .w-menu-item a {display: block; max-width: 160px; text-overflow: ellipsis; overflow: hidden; padding: 0 6px; font-weight: normal; white-space: nowrap; margin: 0!important;} 3 | .w-menu-item .w-menu-options {border-bottom: 1px dashed #ccc; max-height: 320px; overflow-x: hidden; overflow-y: auto;} 4 | .w-menu-item a .glyphicon {margin-right: 8px; font-size: 12px;} 5 | .w-menu-item a .glyphicon-ok, .w-menu-item a .glyphicon-plus {color: #5bbd72;} 6 | -------------------------------------------------------------------------------- /vendor/whistle.scriptfile/src/js/base-css.js: -------------------------------------------------------------------------------- 1 | require('bootstrap/dist/css/bootstrap.css'); 2 | require('../css/base.css'); -------------------------------------------------------------------------------- /vendor/whistle/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "react" 4 | ], 5 | "ignore": [ 6 | "./biz/webui/htdocs/src/js/components/json/eval.js" 7 | ] 8 | } -------------------------------------------------------------------------------- /vendor/whistle/.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | end_of_line = lf 7 | indent_size = 2 8 | indent_style = space 9 | insert_final_newline = true 10 | max_line_length = 80 11 | trim_trailing_whitespace = true 12 | 13 | [*.md] 14 | max_line_length = 0 15 | trim_trailing_whitespace = false 16 | 17 | [COMMIT_EDITMSG] 18 | max_line_length = 0 -------------------------------------------------------------------------------- /vendor/whistle/.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | /biz/webui/htdocs/js 3 | /biz/webui/htdocs/src/js/components 4 | /test/assets/values 5 | -------------------------------------------------------------------------------- /vendor/whistle/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "10" 4 | - "11" 5 | - "12" 6 | - "13" 7 | - "14" 8 | - "15" 9 | 10 | install: 11 | - npm install 12 | 13 | script: 14 | - npm run cov 15 | 16 | after_script: 17 | - npm i codecov && codecov 18 | -------------------------------------------------------------------------------- /vendor/whistle/assets/js/weinre.js: -------------------------------------------------------------------------------- 1 | 2 | ;(function() { 3 | if (typeof window === 'undefined' || window.WeinreServerURL) { 4 | return; 5 | } 6 | window.WeinreServerURL = '$WEINRE_PATH'; 7 | var head = document.head || document.getElementsByTagName('head')[0] || document.documentElement; 8 | var script = document.createElement('script'); 9 | script.async = true; 10 | script.charset = 'utf8'; 11 | script.src = '$WEINRE_URL'; 12 | if (head.firstChild) { 13 | head.insertBefore(script, head.firstChild); 14 | } else { 15 | head.appendChild(script); 16 | } 17 | })(); 18 | -------------------------------------------------------------------------------- /vendor/whistle/assets/launcher/README.md: -------------------------------------------------------------------------------- 1 | # 配置开机重启whistle 2 | 由于whistle是用Node实现的一个命令行程序,相对于客户端程序安装过程多了[安装node、配置代理](https://avwo.github.io/whistle/install.html)这两个步骤及通过命令行启动服务器,而不是点击桌面图标启动,具体参见[安装启动whistle](https://avwo.github.io/whistle/install.html);命令行程序也有一个好处:可以部署在服务器上。事实上,通过把启动脚本写在脚本文件里面(如bat文件)并存在桌面也可以实现双击图标启动whistle,且将该脚本文件放在开机启动项可以实现开机自动重启,具体根据不同的操作系统采取不同的策略: 3 | 4 | 1. [Windows](windows) 5 | 2. [Mac](mac) 6 | 3. [Linux](linux) 7 | -------------------------------------------------------------------------------- /vendor/whistle/assets/launcher/linux/README.md: -------------------------------------------------------------------------------- 1 | # Linux上配置开机重启whistle 2 | 3 | Linux不完全支持双击脚本文件自动执行(需要whistle v1.0.0及以上版本),只能设置开机自动重启whistle,[安装完whistle](https://avwo.github.io/whistle/install.html)后执行`which w2`查看命令行安装的路径(一般为`/usr/local/bin/w2`),编辑启动执行的文件`sudo vi /etc/rc.d/rc.local`,在最后一行加入`/usr/local/bin/w2 restart`(`/usr/local/bin/w2`视`which w2`输出的字符串为准)。 4 | 5 | ![Linux开机重启whistle](whistle.gif) -------------------------------------------------------------------------------- /vendor/whistle/assets/launcher/linux/whistle.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/assets/launcher/linux/whistle.gif -------------------------------------------------------------------------------- /vendor/whistle/assets/launcher/mac/README.md: -------------------------------------------------------------------------------- 1 | # Mac上配置开机重启whistle 2 | 首先,下载Mac上的whistle脚步文件:[whistle.zip](https://github.com/avwo/whistle/raw/avenwu/assets/launcher/mac/whistle.zip)。 3 | 4 | 1. 解压whistle.zip获取whistle脚本文件,把该脚本文件拷贝一份到**应用程序**,打开桌面即可看到whistle这个脚本文件,这样可以直接在Mac的桌面上刊登whistle的启动脚本,点击该文件即可重启whistle; 5 | 6 | ![把whistle脚本文件放到Mac桌面](whistle-desktop.gif) 7 | 8 | 2. **打开设置 --> 打开用户与群组 --> 打开登录项 --> 点击下方的+按钮 --> 在应用程序目录里选择whistle --> 勾选上复选框**,这样就配置好了开机自动重启whistle。 9 | 10 | ![在Mac上配置开机重启whistle](whistle.gif) 11 | -------------------------------------------------------------------------------- /vendor/whistle/assets/launcher/mac/whistle-desktop.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/assets/launcher/mac/whistle-desktop.gif -------------------------------------------------------------------------------- /vendor/whistle/assets/launcher/mac/whistle.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/assets/launcher/mac/whistle.gif -------------------------------------------------------------------------------- /vendor/whistle/assets/launcher/mac/whistle.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/assets/launcher/mac/whistle.zip -------------------------------------------------------------------------------- /vendor/whistle/assets/launcher/windows/README.md: -------------------------------------------------------------------------------- 1 | # Windows上配置开机重启whistle 2 | 首先,下载Windows上的whistle脚步文件:[whistle.zip](https://github.com/avwo/whistle/raw/avenwu/assets/launcher/windows/whistle.zip)。 3 | 4 | 1. 解压whistle.zip获取whistle.bat的脚本文件,把该脚本文件拷贝一份到Windows的桌面,这样可以直接在Mac的桌面上刊登whistle的启动脚本,双击即可重启whistle(会先弹出一个命令行窗口,等3秒左右就会自动消失); 5 | 6 | 2. 把桌面上的whistle.bat文件拖到桌面左下角的系统**开始菜单 --> 所有程序 --> 启动**目录下面,或者直接拷贝到系统目录`C:\Users\{yourAccount}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup`(可以直接在开始菜单或者文件管理器中的输入框输入`%appData%\Microsoft\Windows\Start Menu\Programs\Startup`快速定位到启动菜单目录),这样就配置好了开机自动重启whistle。 7 | 8 | ![设置Windows开机重启whistle](whistle.gif) -------------------------------------------------------------------------------- /vendor/whistle/assets/launcher/windows/whistle.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/assets/launcher/windows/whistle.gif -------------------------------------------------------------------------------- /vendor/whistle/assets/launcher/windows/whistle.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/assets/launcher/windows/whistle.zip -------------------------------------------------------------------------------- /vendor/whistle/biz/init.js: -------------------------------------------------------------------------------- 1 | var http = require('http'); 2 | var ui = require('./webui/lib'); 3 | var util = require('../lib/util'); 4 | 5 | module.exports = function init(proxy, callback) { 6 | var config = proxy.config; 7 | ui.init(proxy); 8 | if (config.customUIPort) { 9 | var server = http.createServer(); 10 | ui.setupServer(server); 11 | util.getBoundIp(config.uihost, function(host) { 12 | if (host) { 13 | server.listen(config.uiport, host, callback); 14 | } else { 15 | server.listen(config.uiport, callback); 16 | } 17 | }); 18 | } else { 19 | callback(); 20 | } 21 | }; 22 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/abort.js: -------------------------------------------------------------------------------- 1 | var proxy = require('../lib/proxy'); 2 | var socketMgr = proxy.socketMgr; 3 | 4 | function abort(reqId) { 5 | proxy.abortRequest(reqId); 6 | socketMgr.abort(reqId); 7 | } 8 | 9 | module.exports = function(req, res) { 10 | var list = req.body.list; 11 | if (list && typeof list === 'string') { 12 | list.split(',').forEach(abort); 13 | } 14 | res.json({ ec: 0 }); 15 | }; 16 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/custom-frames.js: -------------------------------------------------------------------------------- 1 | var proxy = require('../lib/proxy'); 2 | var socketMgr = proxy.socketMgr; 3 | 4 | module.exports = function(req, res) { 5 | var result = {}; 6 | req.body.idList.forEach(function(reqId) { 7 | result[reqId] = socketMgr.getData(reqId); 8 | }); 9 | req.body.frames.forEach(function(frame) { 10 | proxy.emit('frame', frame); 11 | }); 12 | res.json(result); 13 | }; 14 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/custom-handler.js: -------------------------------------------------------------------------------- 1 | var config = require('../../../lib/config'); 2 | 3 | module.exports = function(req, res) { 4 | if (!config.customHandler) { 5 | return res.sendStatus(404); 6 | } 7 | config.customHandler(req, res); 8 | }; 9 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/do-not-show-again.js: -------------------------------------------------------------------------------- 1 | var properties = require('../../../lib/rules/util').properties; 2 | 3 | module.exports = function(req, res) { 4 | properties.set('doNotShowAgainVersion', properties.getLatestVersion('latestVersion')); 5 | res.json({ec: 0, em: 'success'}); 6 | }; 7 | 8 | 9 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/enable-http2.js: -------------------------------------------------------------------------------- 1 | var properties = require('../../../lib/rules/util').properties; 2 | 3 | module.exports = function(req, res) { 4 | properties.setEnableHttp2(req.body.enableHttp2 == 1); 5 | res.json({ec: 0, em: 'success'}); 6 | }; 7 | 8 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/get-custom-certs-files.js: -------------------------------------------------------------------------------- 1 | var getCustomCertsFiles = require('../../../lib/https/ca').getCustomCertsFiles; 2 | 3 | module.exports = function(req, res) { 4 | res.json(getCustomCertsFiles()); 5 | }; 6 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/get-custom-certs-info.js: -------------------------------------------------------------------------------- 1 | var getCustomCertsInfo = require('../../../lib/https/ca').getCustomCertsInfo; 2 | // 给第三方用的,不能删除 3 | module.exports = function(req, res) { 4 | res.json(getCustomCertsInfo()); 5 | }; 6 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/get-frames.js: -------------------------------------------------------------------------------- 1 | var proxy = require('../lib/proxy'); 2 | var socketMgr = proxy.socketMgr; 3 | 4 | module.exports = function(req, res) { 5 | var frames = proxy.getFrames(req.query); 6 | if (frames && !frames.length && 7 | !socketMgr.exists(req.query.curReqId)) { 8 | frames = undefined; 9 | } 10 | res.json({ 11 | ec: 0, 12 | frames: frames 13 | }); 14 | }; 15 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/hide-https-connects.js: -------------------------------------------------------------------------------- 1 | module.exports = function(req, res) { 2 | res.json({ec: 0, em: 'success'}); 3 | }; 4 | 5 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/history.js: -------------------------------------------------------------------------------- 1 | var properties = require('../../../lib/rules/util').properties; 2 | 3 | module.exports = function(req, res) { 4 | res.json(properties.getHistory()); 5 | }; 6 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/intercept-https-connects.js: -------------------------------------------------------------------------------- 1 | var properties = require('../../../lib/rules/util').properties; 2 | 3 | module.exports = function(req, res) { 4 | properties.setEnableCapture(req.body.interceptHttpsConnects == 1); 5 | res.json({ec: 0, em: 'success'}); 6 | }; 7 | 8 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/log/set.js: -------------------------------------------------------------------------------- 1 | var proxy = require('../../lib/proxy'); 2 | 3 | module.exports = function(req, res) { 4 | proxy.addLog(req.query); 5 | res.setHeader('content-type', 'image/png'); 6 | res.end(); 7 | }; 8 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/plugins/disable-all-plugins.js: -------------------------------------------------------------------------------- 1 | var properties = require('../../../../lib/rules/util').properties; 2 | var pluginMgr = require('../../lib/proxy').pluginMgr; 3 | 4 | module.exports = function(req, res) { 5 | properties.set('disabledAllPlugins', req.body.disabledAllPlugins == 1); 6 | pluginMgr.updateRules(); 7 | res.json({ec: 0, em: 'success'}); 8 | }; 9 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/plugins/disable-plugin.js: -------------------------------------------------------------------------------- 1 | var properties = require('../../../../lib/rules/util').properties; 2 | var pluginMgr = require('../../lib/proxy').pluginMgr; 3 | 4 | module.exports = function(req, res) { 5 | var disabledPlugins = properties.get('disabledPlugins') || {}; 6 | if (req.body.disabled == 1) { 7 | disabledPlugins[req.body.name] = 1; 8 | } else { 9 | delete disabledPlugins[req.body.name]; 10 | } 11 | properties.set('disabledPlugins', disabledPlugins); 12 | pluginMgr.updateRules(); 13 | res.json({ec: 0, data: disabledPlugins}); 14 | }; 15 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/plugins/get-plugins.js: -------------------------------------------------------------------------------- 1 | var properties = require('../../../../lib/rules/util').properties; 2 | var pluginMgr = require('../../lib/proxy').pluginMgr; 3 | 4 | module.exports = function(req, res) { 5 | res.json({ 6 | ec: 0, 7 | plugins: pluginMgr.getPlugins(), 8 | disabledPlugins: properties.get('disabledPlugins') || {}, 9 | disabledAllPlugins: properties.get('disabledAllPlugins') 10 | }); 11 | }; 12 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/plugins/is-enable.js: -------------------------------------------------------------------------------- 1 | var pluginMgr = require('../../lib/proxy').pluginMgr; 2 | var config = require('../../../../lib/config'); 3 | 4 | module.exports = function(req, res) { 5 | var name = req.headers[config.PROXY_ID_HEADER]; 6 | res.json({ 7 | ec: 0, 8 | enable: !!name && !!pluginMgr.getPlugin(name + ':') 9 | }); 10 | }; 11 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/plugins/update-rules.js: -------------------------------------------------------------------------------- 1 | var config = require('../../../../lib/config'); 2 | var pluginMgr = require('../../lib/proxy').pluginMgr; 3 | 4 | module.exports = function(req, res) { 5 | var name = req.headers[config.PROXY_ID_HEADER]; 6 | pluginMgr.updatePluginRules(name); 7 | res.json({ec: 0}); 8 | }; 9 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/reset-local-address.js: -------------------------------------------------------------------------------- 1 | var util = require('../../../lib/util'); 2 | 3 | module.exports = function(req, res) { 4 | util.localIpCache.reset(); 5 | res.json({ec: 0, em: 'success'}); 6 | }; 7 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/rootca.js: -------------------------------------------------------------------------------- 1 | var getRootCAFile = require('../../../lib/https/ca').getRootCAFile; 2 | 3 | module.exports = function(req, res) { 4 | res.download(getRootCAFile(), 'rootCA.' + (req.query.type === 'cer' ? 'cer' : 'crt')); 5 | }; 6 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/rules/add.js: -------------------------------------------------------------------------------- 1 | var rules = require('../../../../lib/rules/util').rules; 2 | var recycleBin = require('../../../../lib/rules/util').rules.recycleBin; 3 | 4 | module.exports = function(req, res) { 5 | var body = req.body; 6 | rules.add(body.name, body.value, body.clientId); 7 | if (req.body.recycleFilename) { 8 | recycleBin.remove(req.body.recycleFilename); 9 | } 10 | res.json({ 11 | ec: 0, 12 | list: recycleBin.list() 13 | }); 14 | }; 15 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/rules/allow-multiple-choice.js: -------------------------------------------------------------------------------- 1 | var properties = require('../../../../lib/rules/util').properties; 2 | 3 | module.exports = function(req, res) { 4 | properties.set('allowMultipleChoice', req.body.allowMultipleChoice == 1); 5 | res.json({ec: 0, em: 'success'}); 6 | }; 7 | 8 | 9 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/rules/disable-all-rules.js: -------------------------------------------------------------------------------- 1 | var properties = require('../../../../lib/rules/util').properties; 2 | var rules = require('../../../../lib/rules/util').rules; 3 | 4 | module.exports = function(req, res) { 5 | properties.set('disabledAllRules', req.body.disabledAllRules == 1); 6 | rules.parseRules(); 7 | res.json({ec: 0, em: 'success'}); 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/rules/disable-default.js: -------------------------------------------------------------------------------- 1 | var rules = require('../../../../lib/rules/util').rules; 2 | 3 | module.exports = function(req, res) { 4 | rules.disableDefault(); 5 | res.json({ec: 0, em: 'success', defaultRulesIsDisabled: rules.defaultRulesIsDisabled(), list: rules.getSelectedList()}); 6 | }; 7 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/rules/enable-back-rules-first.js: -------------------------------------------------------------------------------- 1 | var rules = require('../../../../lib/rules/util').rules; 2 | 3 | module.exports = function(req, res) { 4 | rules.enableBackRulesFirst(req.body.backRulesFirst === '1'); 5 | res.json({ec: 0, em: 'success'}); 6 | }; 7 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/rules/enable-default.js: -------------------------------------------------------------------------------- 1 | var rules = require('../../../../lib/rules/util').rules; 2 | 3 | module.exports = function(req, res) { 4 | rules.enableDefault(); 5 | rules.setDefault(req.body.value, req.body.clientId); 6 | res.json({ec: 0, em: 'success', defaultRulesIsDisabled: rules.defaultRulesIsDisabled(), list: rules.getSelectedList()}); 7 | }; 8 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/rules/import.js: -------------------------------------------------------------------------------- 1 | var get = require('./index'); 2 | var getReqData = require('../util').getReqData; 3 | var addRules = require('../../../../lib/rules/util').addRules; 4 | 5 | module.exports = function(req, res) { 6 | getReqData(req, function(err, result) { 7 | if (err) { 8 | res.status(200).json({ ec: 2, em: err.message }); 9 | } else { 10 | addRules(result.data, result.replace, req.query.clientId); 11 | res.json(get()); 12 | } 13 | }); 14 | }; 15 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/rules/index.js: -------------------------------------------------------------------------------- 1 | var rules = require('../../../../lib/rules/util').rules; 2 | var properties = require('../../../../lib/rules/util').properties; 3 | 4 | module.exports = function get() { 5 | return { 6 | ec: 0, 7 | defaultRulesIsDisabled: rules.defaultRulesIsDisabled(), 8 | defaultRules: rules.getDefault(), 9 | allowMultipleChoice: properties.get('allowMultipleChoice'), 10 | backRulesFirst: properties.get('backRulesFirst'), 11 | list: rules.list() 12 | }; 13 | }; 14 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/rules/list.js: -------------------------------------------------------------------------------- 1 | var get = require('./index'); 2 | 3 | module.exports = function(req, res) { 4 | res.json(get()); 5 | }; 6 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/rules/list2.js: -------------------------------------------------------------------------------- 1 | var get = require('./index'); 2 | 3 | module.exports = function(req, res) { 4 | var rules = get(); 5 | var data = { 6 | Default: rules.defaultRules 7 | }; 8 | rules.list.forEach(function(item) { 9 | data[item.name] = item.data; 10 | }); 11 | res.json(data); 12 | }; 13 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/rules/move-to.js: -------------------------------------------------------------------------------- 1 | var rules = require('../../../../lib/rules/util').rules; 2 | 3 | module.exports = function(req, res) { 4 | var body = req.body; 5 | var result = rules.moveTo(body.from, body.to, body.clientId); 6 | res.json({ec: result ? 0 : 2, em: 'success'}); 7 | }; 8 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/rules/recycle/list.js: -------------------------------------------------------------------------------- 1 | var recycleBin = require('../../../../../lib/rules/util').rules.recycleBin; 2 | 3 | module.exports = function(req, res) { 4 | res.json({ 5 | ec: 0, 6 | list: recycleBin.list() 7 | }); 8 | }; 9 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/rules/recycle/remove.js: -------------------------------------------------------------------------------- 1 | var recycleBin = require('../../../../../lib/rules/util').rules.recycleBin; 2 | 3 | module.exports = function(req, res) { 4 | recycleBin.remove(req.body.name); 5 | res.json({ 6 | ec: 0, 7 | list: recycleBin.list() 8 | }); 9 | }; 10 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/rules/recycle/view.js: -------------------------------------------------------------------------------- 1 | var recycleBin = require('../../../../../lib/rules/util').rules.recycleBin; 2 | 3 | module.exports = function(req, res) { 4 | var item = recycleBin.getFile(req.query.name); 5 | res.json({ 6 | ec: item ? 0 : 3, 7 | data: item && item.data 8 | }); 9 | }; 10 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/rules/remove.js: -------------------------------------------------------------------------------- 1 | var rules = require('../../../../lib/rules/util').rules; 2 | 3 | module.exports = function(req, res) { 4 | rules.remove(req.body.name, req.body.clientId); 5 | res.json({ec: 0, em: 'success'}); 6 | }; 7 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/rules/rename.js: -------------------------------------------------------------------------------- 1 | var rules = require('../../../../lib/rules/util').rules; 2 | 3 | module.exports = function(req, res) { 4 | var body = req.body; 5 | rules.rename(body.name, body.newName, body.clientId); 6 | res.json({ec: 0, em: 'success'}); 7 | }; 8 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/rules/select.js: -------------------------------------------------------------------------------- 1 | var rules = require('../../../../lib/rules/util').rules; 2 | 3 | module.exports = function(req, res) { 4 | var body = req.body; 5 | rules.add(body.name, body.value, body.clientId); 6 | rules.select(req.body.name); 7 | res.json({ec: 0, em: 'success', defaultRulesIsDisabled: rules.defaultRulesIsDisabled(), list: rules.getSelectedList()}); 8 | }; 9 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/rules/set-sys-hosts.js: -------------------------------------------------------------------------------- 1 | var rules = require('../../../../lib/rules/util').rules; 2 | 3 | module.exports = function(req, res) { 4 | rules.setSysHosts(req.body.hosts, function(err) { 5 | res.json({ec: err ? 2 : 0, em: err ? err.stack : 'success'}); 6 | }); 7 | }; 8 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/rules/unselect.js: -------------------------------------------------------------------------------- 1 | var rules = require('../../../../lib/rules/util').rules; 2 | 3 | module.exports = function(req, res) { 4 | rules.add(req.body.name, req.body.value); 5 | rules.unselect(req.body.name); 6 | res.json({ec: 0, em: 'success', defaultRulesIsDisabled: rules.defaultRulesIsDisabled(), list: rules.getSelectedList()}); 7 | }; 8 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/server-info.js: -------------------------------------------------------------------------------- 1 | var util = require('./util'); 2 | 3 | module.exports = function(req, res) { 4 | res.json({ec: 0, server: util.getServerInfo(req)}); 5 | }; 6 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/sessions/expimp.js: -------------------------------------------------------------------------------- 1 | var loadService = require('../../lib/proxy').loadService; 2 | var transformReq = require('../../../../lib/util').transformReq; 3 | 4 | module.exports = function(req, res) { 5 | loadService(function(err, options) { 6 | if (err) { 7 | res.type('text').status(500).send(err.stack || err); 8 | } else { 9 | transformReq(req, res, options.port); 10 | } 11 | }); 12 | }; 13 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/sessions/export.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./expimp'); 2 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/sessions/import.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./expimp'); 2 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/set-custom-column.js: -------------------------------------------------------------------------------- 1 | var properties = require('../../../lib/rules/util').properties; 2 | 3 | function updateName(name, value) { 4 | if (!value || typeof value !== 'string') { 5 | value = name; 6 | } else { 7 | value = value.trim().toString(0, 16); 8 | } 9 | properties.set(name, value); 10 | } 11 | 12 | module.exports = function(req, res) { 13 | var name = req.body.name; 14 | var value = req.body.value; 15 | if (name === 'Custom1' || name === 'Custom2') { 16 | updateName(name, value); 17 | } 18 | res.json({ ec: 0 }); 19 | }; 20 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/socket/abort.js: -------------------------------------------------------------------------------- 1 | var socketMgr = require('../../lib/proxy').socketMgr; 2 | 3 | module.exports = function(req, res) { 4 | socketMgr.abort(req.body.reqId); 5 | res.json({ec: 0}); 6 | }; 7 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/socket/change-status.js: -------------------------------------------------------------------------------- 1 | var socketMgr = require('../../lib/proxy').socketMgr; 2 | 3 | module.exports = function(req, res) { 4 | socketMgr.changeStatus(req.body); 5 | res.json({ec: 0}); 6 | }; 7 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/socket/data.js: -------------------------------------------------------------------------------- 1 | var socketMgr = require('../../lib/proxy').socketMgr; 2 | 3 | module.exports = function(req, res) { 4 | var result = socketMgr.sendData(req.body); 5 | res.json({ec: result === false ? 3 : 0}); 6 | }; 7 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/values/add.js: -------------------------------------------------------------------------------- 1 | var values = require('../../../../lib/rules/util').values; 2 | var recycleBin = require('../../../../lib/rules/util').values.recycleBin; 3 | 4 | module.exports = function(req, res) { 5 | var body = req.body; 6 | values.add(body.name, body.value, body.clientId); 7 | if (req.body.recycleFilename) { 8 | recycleBin.remove(req.body.recycleFilename); 9 | } 10 | res.json({ 11 | ec: 0, 12 | list: recycleBin.list() 13 | }); 14 | }; 15 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/values/check-file.js: -------------------------------------------------------------------------------- 1 | var values = require('../../../../lib/rules/util').values; 2 | 3 | var LIMIMT_FILES_COUNT = values.LIMIMT_FILES_COUNT; 4 | 5 | module.exports = function (req, res) { 6 | var files = values.getUploadFiles(); 7 | var count = parseInt(req.body.count, 10) || 0; 8 | var len = files.length; 9 | var isMax = len >= LIMIMT_FILES_COUNT && count < LIMIMT_FILES_COUNT; 10 | var exists = values.existsFile(req.body.name); 11 | res.json({ 12 | ec: 0, 13 | em: 'success', 14 | isMax: isMax, 15 | length: len, 16 | exists: exists, 17 | files: !isMax && exists ? undefined : files 18 | }); 19 | }; 20 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/values/download.js: -------------------------------------------------------------------------------- 1 | var values = require('../../../../lib/rules/util').values; 2 | 3 | module.exports = function(req, res) { 4 | values.download(req.query.name, res); 5 | }; 6 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/values/get.js: -------------------------------------------------------------------------------- 1 | var values = require('../../../../lib/rules/util').values; 2 | var properties = require('../../../../lib/rules/util').properties; 3 | 4 | module.exports = function(req, res) { 5 | res.json({ 6 | fontSize: properties.get('valuesFontSize'), 7 | theme: properties.get('valuesTheme'), 8 | showLineNumbers: properties.get('valuesShowLineNumbers'), 9 | values: values.list() 10 | }); 11 | }; 12 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/values/import.js: -------------------------------------------------------------------------------- 1 | var get = require('./index'); 2 | var getReqData = require('../util').getReqData; 3 | var addValues = require('../../../../lib/rules/util').addValues; 4 | 5 | module.exports = function(req, res) { 6 | getReqData(req, function(err, result) { 7 | if (err) { 8 | res.status(200).json({ ec: 2, em: err.message }); 9 | } else { 10 | addValues(result.data, result.replace, req.query.clientId); 11 | res.json(get()); 12 | } 13 | }); 14 | }; 15 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/values/index.js: -------------------------------------------------------------------------------- 1 | var rulesUtil = require('../../../../lib/rules/util'); 2 | var values = rulesUtil.values; 3 | 4 | module.exports = function get() { 5 | return { 6 | ec: 0, 7 | list: values.list() 8 | }; 9 | }; 10 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/values/list.js: -------------------------------------------------------------------------------- 1 | var get = require('./index'); 2 | 3 | module.exports = function(req, res) { 4 | res.json(get()); 5 | }; 6 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/values/list2.js: -------------------------------------------------------------------------------- 1 | var get = require('./index'); 2 | 3 | module.exports = function(req, res) { 4 | var data = {}; 5 | get().list.forEach(function(item) { 6 | data[item.name] = item.data; 7 | }); 8 | res.json(data); 9 | }; 10 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/values/move-to.js: -------------------------------------------------------------------------------- 1 | var values = require('../../../../lib/rules/util').values; 2 | 3 | module.exports = function(req, res) { 4 | var body = req.body; 5 | var result = values.moveTo(body.from, body.to, body.clientId); 6 | res.json({ec: result ? 0 : 2, em: 'success'}); 7 | }; 8 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/values/recycle/list.js: -------------------------------------------------------------------------------- 1 | var recycleBin = require('../../../../../lib/rules/util').values.recycleBin; 2 | 3 | module.exports = function(req, res) { 4 | res.json({ 5 | ec: 0, 6 | list: recycleBin.list() 7 | }); 8 | }; 9 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/values/recycle/remove.js: -------------------------------------------------------------------------------- 1 | var recycleBin = require('../../../../../lib/rules/util').values.recycleBin; 2 | 3 | module.exports = function(req, res) { 4 | recycleBin.remove(req.body.name); 5 | res.json({ 6 | ec: 0, 7 | list: recycleBin.list() 8 | }); 9 | }; 10 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/values/recycle/view.js: -------------------------------------------------------------------------------- 1 | var recycleBin = require('../../../../../lib/rules/util').values.recycleBin; 2 | 3 | module.exports = function(req, res) { 4 | var item = recycleBin.getFile(req.query.name); 5 | res.json({ 6 | ec: item ? 0 : 3, 7 | data: item && item.data 8 | }); 9 | }; 10 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/values/remove-file.js: -------------------------------------------------------------------------------- 1 | var values = require('../../../../lib/rules/util').values; 2 | 3 | module.exports = function (req, res) { 4 | values.removeUploadFile(req.body.name, function(err) { 5 | var result = { ec: 0, em: 'success' }; 6 | if (err) { 7 | result.ec = 2; 8 | result.em = err.message || 'Internal Serve Error'; 9 | } else { 10 | result.files = values.getUploadFiles(); 11 | } 12 | res.json(result); 13 | }); 14 | }; 15 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/values/remove.js: -------------------------------------------------------------------------------- 1 | var values = require('../../../../lib/rules/util').values; 2 | 3 | module.exports = function(req, res) { 4 | values.remove(req.body.name, req.body.clientId); 5 | res.json({ec: 0, em: 'success'}); 6 | }; 7 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/values/rename.js: -------------------------------------------------------------------------------- 1 | var values = require('../../../../lib/rules/util').values; 2 | 3 | module.exports = function(req, res) { 4 | var body = req.body; 5 | values.rename(body.name, body.newName, body.clientId); 6 | res.json({ec: 0, em: 'success'}); 7 | }; 8 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/cgi-bin/values/upload.js: -------------------------------------------------------------------------------- 1 | var values = require('../../../../lib/rules/util').values; 2 | 3 | module.exports = function(req, res) { 4 | values.addUploadFile(req.body, function(err) { 5 | var result = { ec: 0, em: 'success' }; 6 | if (err) { 7 | result.ec = 2; 8 | result.em = err.message || 'Internal Serve Error'; 9 | } else { 10 | result.files = values.getUploadFiles(); 11 | } 12 | res.json(result); 13 | }); 14 | }; 15 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/htdocs.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var ROOT = path.join(__dirname, 'htdocs'); 3 | 4 | function getHtmlFile(file) { 5 | return path.join(ROOT, file || ''); 6 | } 7 | 8 | exports.getHtmlFile = getHtmlFile; 9 | 10 | function getImgFile(file) { 11 | return path.join(ROOT, 'img', file || ''); 12 | } 13 | 14 | exports.getImgFile = getImgFile; 15 | 16 | function getJsFile(file) { 17 | return path.join(ROOT, 'js', file || ''); 18 | } 19 | 20 | exports.getJsFile = getJsFile; 21 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/htdocs/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/biz/webui/htdocs/img/favicon.ico -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/htdocs/img/qrcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/biz/webui/htdocs/img/qrcode.png -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/htdocs/img/whistle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/biz/webui/htdocs/img/whistle.png -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/htdocs/src/css/btn-group.css: -------------------------------------------------------------------------------- 1 | .w-tabs-sm {border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; width: 100%;} 2 | .w-tabs-sm .btn {border-radius: 0; border-bottom: none; border-top: none; padding: 4px 10px 3px; overflow: hidden; font-size: 14px;} 3 | .w-tabs-sm .btn:first-child {border-left: none;} 4 | 5 | .w-btn-group-sm {border-bottom: 1px solid #ccc; width: 100%;} 6 | .w-btn-group-sm .btn {padding: 2px 10px 1px!important; border-radius: 0; border-top: none; border-bottom: none;} 7 | .w-btn-group-sm .btn:first-child {border-left: none;} 8 | .w-btn-group-sm.small .btn {padding: 0 8px!important; font-size: 12px; line-height: 16px;} 9 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/htdocs/src/css/editor-settings.css: -------------------------------------------------------------------------------- 1 | .w-editor-settings label, .w-editor-settings-box label {font-weight: normal; white-space: nowrap;} 2 | .w-editor-settings label .w-label {display: inline-block; width: 60px; text-align: right; margin-right: 5px;} 3 | .w-editor-settings select {width: 186px;} 4 | .w-rules-settings-dialog .w-editor-settings select {width: 260px;} 5 | .w-editor-settings-box {padding-left: 65px; margin: 10px!important;} 6 | .w-editor-settings .form-control {display: inline-block; margin-left: 5px;} 7 | .w-editor-settings p {margin: 5px;} -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/htdocs/src/css/editor.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-hints li.CodeMirror-hint-active:after { 2 | content: 'F1'; 3 | position: absolute; 4 | right: 0; 5 | font-size: 12px; 6 | 7 | } 8 | 9 | .CodeMirror-hints .CodeMirror-hint { 10 | max-width: unset; 11 | position: relative; 12 | padding-right: 20px; 13 | font-family: consolas, monospace; 14 | font-size: 14px; 15 | } 16 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/htdocs/src/css/image-view.css: -------------------------------------------------------------------------------- 1 | .w-image-view { 2 | font-size: 0; 3 | white-space: nowrap; 4 | overflow: auto; 5 | text-align: center; 6 | padding-top: 30px; 7 | padding-bottom: 10px; 8 | position: relative; 9 | } 10 | .w-image-view img { 11 | max-width: 100%; 12 | } 13 | .w-image-view a { 14 | display: inline-block; 15 | width: 300px; 16 | line-height: 30px; 17 | position: absolute; 18 | top: 50%; 19 | left: 50%; 20 | margin: -15px 0 0 -150px; 21 | font-size: 14px; 22 | } 23 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/htdocs/src/css/json-viewer.css: -------------------------------------------------------------------------------- 1 | .w-properties-wrap:hover .w-textarea-bar { display: inline-block; } 2 | .w-textarea-bar:hover .w-download {display: inline-block;} 3 | .w-textarea-bar .w-properties-btn { position: static; } 4 | .w-json-viewer-str, .w-json-viewer-tree { padding: 5px; overflow: auto; } 5 | .w-json-viewer-tree>ul { background: none!important; font-size: 12px; margin: 0!important; } -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/htdocs/src/css/kv.css: -------------------------------------------------------------------------------- 1 | .w-kv-dialog .modal-dialog { 2 | width: 666px; 3 | } 4 | .w-kv-name { 5 | width: 400px; 6 | } 7 | .w-kv-operation a:nth-child(2) { 8 | color: #f66; 9 | margin: 0 20px; 10 | } 11 | .w-kv-conflict th, .w-kv-operation strong { 12 | color: #f66; 13 | } 14 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/htdocs/src/css/list-dialog.css: -------------------------------------------------------------------------------- 1 | .w-list-dialog label { line-height: 26px; width: 226px; overflow: hidden; 2 | text-overflow: ellipsis; white-space: nowrap; margin-left: 10px; } 3 | .w-list-dialog label input { margin-right: 5px; } 4 | .w-list-dialog {width: 500px;} 5 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/htdocs/src/css/message.css: -------------------------------------------------------------------------------- 1 | .w-message { 2 | position: fixed; 3 | top: 30px; 4 | left: 50%; 5 | z-index: 999999999; 6 | padding: 8px 20px!important; 7 | max-width: 410px; 8 | } 9 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/htdocs/src/css/modal.css: -------------------------------------------------------------------------------- 1 | .w-dialog-for-plguin .modal-header h4 { 2 | font-size: 14px; 3 | font-weight: bold; 4 | } 5 | 6 | .w-dialog-for-plguin .modal-header { 7 | padding: 5px 10px; 8 | position: relative; 9 | display: none; 10 | } 11 | 12 | .w-dialog-for-plguin .modal-header button { 13 | position: absolute; 14 | top: 10px; 15 | right: 10px; 16 | } 17 | .w-context-menu li[data-menu-action=Remove] ul, .w-context-menu li[data-menu-action="+Value"] ul { 18 | top: -30px!important; 19 | } 20 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/htdocs/src/css/online.css: -------------------------------------------------------------------------------- 1 | .w-online-dialog .modal-dialog {width: 320px;} 2 | .w-online-dialog-info { display: none; } 3 | .w-online-dialog-ctn h5 {padding: 5px 0; margin: 0; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; overflow: hidden;} 4 | .w-online-dialog-ctn p {margin: -23px 0 5px 36px} 5 | .w-confirm-reload-dialog .modal-dialog {width: 280px;} 6 | .w-confirm-reload-dialog .w-confirm-reload {font-weight: bold; line-height: 1.8; padding: 10px 20px;} 7 | .w-confim-reload-note { color: red; margin: 0; } -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/htdocs/src/css/overview.css: -------------------------------------------------------------------------------- 1 | .w-detail-overview>.w-properties-wrap:last-child {border-top: 1px solid #ccc;} 2 | .w-detail-overview-title {margin: 0; padding: 6px 5px 0;} 3 | .w-detail-overview-title:after { 4 | content:""; 5 | display: block; 6 | clear:both; 7 | } 8 | .w-detail-overview-title a {text-decoration: none!important; color: #333; float: left;} 9 | .w-detail-overview-title label { float: right; font-weight: normal; } 10 | .w-detail-overview-title label input { margin-right: 5px; vertical-align:text-bottom; } 11 | .w-detail-overview-title a:hover {color: #337ab7;} -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/htdocs/src/css/record-btn.css: -------------------------------------------------------------------------------- 1 | .w-refresh-menu-list .glyphicon-minus-sign, .w-refresh-menu-list .w-menu-item .glyphicon-stop { 2 | color: #ccc!important; 3 | } -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/htdocs/src/css/res-detail.css: -------------------------------------------------------------------------------- 1 | .w-detail-response textarea {padding: 5px; border: none;} 2 | .w-detail-response-headers, .w-detail-response-cookies {overflow: auto;} 3 | .w-detail-response-cookies table { table-layout: auto } 4 | .w-detail-response-cookies thead>th { white-space: nowrap; background: #fafafa; } 5 | .w-detail-response-cookies tbody>tr>td:nth-child(7), 6 | .w-detail-response-cookies tbody>tr>td:nth-child(8) { text-align: center; vertical-align: middle; } 7 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/htdocs/src/css/sync-dialog.css: -------------------------------------------------------------------------------- 1 | .w-sync-dialog .modal-dialog { 2 | width: 420px; 3 | } 4 | 5 | .w-sync-dialog .modal-body .btn { 6 | display: block; 7 | width: 398px; 8 | line-height: 40px; 9 | font-size: 18px; 10 | margin: 10px 0; 11 | } 12 | 13 | .w-sync-dialog .modal-body .btn span { 14 | margin-right: 10px; 15 | } 16 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/htdocs/src/css/table.css: -------------------------------------------------------------------------------- 1 | .w-table>thead>tr>th { 2 | background: #eee; 3 | font-weight: normal; 4 | border-bottom: 1px solid #ccc; 5 | vertical-align: top; 6 | } 7 | 8 | .w-table th, 9 | .w-table td { 10 | font-size: 12px; 11 | padding: 3px 5px !important; 12 | border-top: none; 13 | border-bottom: 1px solid #ccc; 14 | word-break: break-word; 15 | } 16 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/htdocs/src/css/values.css: -------------------------------------------------------------------------------- 1 | .w-values-list a .glyphicon-ok {display: none!important;} -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/htdocs/src/js/base-css.js: -------------------------------------------------------------------------------- 1 | require('bootstrap/dist/css/bootstrap.css'); 2 | require('../css/base.css'); -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/htdocs/src/js/components/json/eval.js: -------------------------------------------------------------------------------- 1 | var JSON_RE = /^\s*(?:\{[\w\W]*\}|\[[\w\W]*\])\s*$/; 2 | var ctx = {}; 3 | var throwError = { 4 | get: function() { 5 | throw new Error('undefined'); 6 | } 7 | }; 8 | 9 | if (Object.defineProperty) { 10 | Object.defineProperty(ctx, 'console', throwError); 11 | for (var i in window) { 12 | ctx[i] = undefined; 13 | Object.defineProperty(ctx, i, throwError); 14 | } 15 | } 16 | 17 | function evalJson(str) { 18 | if (!JSON_RE.test(str)) { 19 | return; 20 | } 21 | with(ctx) { 22 | try { 23 | return eval('(' + str + ')'); 24 | } catch(e) {} 25 | } 26 | } 27 | 28 | module.exports = evalJson; -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/htdocs/src/js/components/json/index.js: -------------------------------------------------------------------------------- 1 | exports.parse = require('./parse'); 2 | exports.stringify = require('./stringify'); 3 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/htdocs/src/js/components/react-json-tree/themes/solarized.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.__esModule = true; 4 | exports['default'] = { 5 | scheme: 'solarized', 6 | author: 'ethan schoonover (http://ethanschoonover.com/solarized)', 7 | base00: '#002b36', 8 | base01: '#073642', 9 | base02: '#586e75', 10 | base03: '#657b83', 11 | base04: '#839496', 12 | base05: '#93a1a1', 13 | base06: '#eee8d5', 14 | base07: '#fdf6e3', 15 | base08: '#dc322f', 16 | base09: '#cb4b16', 17 | base0A: '#b58900', 18 | base0B: '#859900', 19 | base0C: '#2aa198', 20 | base0D: '#268bd2', 21 | base0E: '#6c71c4', 22 | base0F: '#d33682' 23 | }; -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/htdocs/src/js/components/react-json-tree/utils/hexToRgb.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | exports.__esModule = true; 4 | 5 | exports["default"] = function (hex) { 6 | var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); 7 | return result ? { 8 | r: parseInt(result[1], 16), 9 | g: parseInt(result[2], 16), 10 | b: parseInt(result[3], 16) 11 | } : null; 12 | }; -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/htdocs/src/js/events.js: -------------------------------------------------------------------------------- 1 | var $ = require('jquery'); 2 | 3 | module.exports = $({}); -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/htdocs/src/js/favorites.js: -------------------------------------------------------------------------------- 1 | var React = require('react'); 2 | 3 | var Favorites = React.createClass({ 4 | 5 | render: function() { 6 | return ( 7 |
8 | Favorites 9 |
10 | ); 11 | } 12 | }); 13 | 14 | module.exports = Favorites; 15 | -------------------------------------------------------------------------------- /vendor/whistle/biz/webui/lib/proxy.js: -------------------------------------------------------------------------------- 1 | module.exports = function(proxy) { 2 | module.exports = proxy; 3 | }; 4 | -------------------------------------------------------------------------------- /vendor/whistle/biz/weinre.js: -------------------------------------------------------------------------------- 1 | var startWeinre = require('weinre2').run; 2 | 3 | module.exports = startWeinre({ 4 | verbose: false, 5 | debug: false, 6 | readTimeout: 5, 7 | deathTimeout: 15 8 | }); 9 | -------------------------------------------------------------------------------- /vendor/whistle/docs/LANGS.md: -------------------------------------------------------------------------------- 1 | # Languages 2 | 3 | * [English](en/) 4 | * [中文](zh/) 5 | -------------------------------------------------------------------------------- /vendor/whistle/docs/assets/host01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/assets/host01.png -------------------------------------------------------------------------------- /vendor/whistle/docs/assets/host02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/assets/host02.png -------------------------------------------------------------------------------- /vendor/whistle/docs/assets/whistle-en_US.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/assets/whistle-en_US.png -------------------------------------------------------------------------------- /vendor/whistle/docs/en/README.md: -------------------------------------------------------------------------------- 1 | # whistle 2 | 3 | [README](https://github.com/avwo/whistle#readme) 4 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/feedback.md: -------------------------------------------------------------------------------- 1 | # User feedback 2 | 3 | 1. File an issue if you have any questions: [New issue](https://github.com/avwo/whistle/issues/new) 4 | 2. PR is welcome: [Pull requests](https://github.com/avwo/whistle/compare) 5 | 3. QQ group: 462558941 (QQ is popular in China) 6 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/gitbook/images/apple-touch-icon-precomposed-152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/en/gitbook/images/apple-touch-icon-precomposed-152.png -------------------------------------------------------------------------------- /vendor/whistle/docs/en/gitbook/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/en/gitbook/images/favicon.ico -------------------------------------------------------------------------------- /vendor/whistle/docs/en/img/Android_proxy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/en/img/Android_proxy.png -------------------------------------------------------------------------------- /vendor/whistle/docs/en/img/composer.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/en/img/composer.gif -------------------------------------------------------------------------------- /vendor/whistle/docs/en/img/firefox-proxy-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/en/img/firefox-proxy-1.jpg -------------------------------------------------------------------------------- /vendor/whistle/docs/en/img/firefox-proxy-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/en/img/firefox-proxy-2.jpg -------------------------------------------------------------------------------- /vendor/whistle/docs/en/img/https.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/en/img/https.gif -------------------------------------------------------------------------------- /vendor/whistle/docs/en/img/iOS-proxy-all.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/en/img/iOS-proxy-all.jpg -------------------------------------------------------------------------------- /vendor/whistle/docs/en/img/iOS-proxy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/en/img/iOS-proxy.jpg -------------------------------------------------------------------------------- /vendor/whistle/docs/en/img/iOS_proxy.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/en/img/iOS_proxy.PNG -------------------------------------------------------------------------------- /vendor/whistle/docs/en/img/iOS_proxy_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/en/img/iOS_proxy_settings.png -------------------------------------------------------------------------------- /vendor/whistle/docs/en/img/ios10.3_ca.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/en/img/ios10.3_ca.PNG -------------------------------------------------------------------------------- /vendor/whistle/docs/en/img/linux-proxy-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/en/img/linux-proxy-1.jpg -------------------------------------------------------------------------------- /vendor/whistle/docs/en/img/linux-proxy-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/en/img/linux-proxy-2.jpg -------------------------------------------------------------------------------- /vendor/whistle/docs/en/img/log.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/en/img/log.gif -------------------------------------------------------------------------------- /vendor/whistle/docs/en/img/mac-proxy-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/en/img/mac-proxy-1.jpg -------------------------------------------------------------------------------- /vendor/whistle/docs/en/img/mac-proxy-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/en/img/mac-proxy-2.jpg -------------------------------------------------------------------------------- /vendor/whistle/docs/en/img/network.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/en/img/network.gif -------------------------------------------------------------------------------- /vendor/whistle/docs/en/img/online.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/en/img/online.gif -------------------------------------------------------------------------------- /vendor/whistle/docs/en/img/plugins.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/en/img/plugins.gif -------------------------------------------------------------------------------- /vendor/whistle/docs/en/img/rules.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/en/img/rules.gif -------------------------------------------------------------------------------- /vendor/whistle/docs/en/img/seq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/en/img/seq.png -------------------------------------------------------------------------------- /vendor/whistle/docs/en/img/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/en/img/settings.png -------------------------------------------------------------------------------- /vendor/whistle/docs/en/img/start_w2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/en/img/start_w2.jpg -------------------------------------------------------------------------------- /vendor/whistle/docs/en/img/switchyomega.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/en/img/switchyomega.jpg -------------------------------------------------------------------------------- /vendor/whistle/docs/en/img/values.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/en/img/values.gif -------------------------------------------------------------------------------- /vendor/whistle/docs/en/img/weinre.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/en/img/weinre.gif -------------------------------------------------------------------------------- /vendor/whistle/docs/en/img/windows_rootca.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/en/img/windows_rootca.jpeg -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/accept.md: -------------------------------------------------------------------------------- 1 | # accept 2 | 3 | 修改请求头的accept字段,accept字段主要告诉服务器该请求可以接受什么类型的数据,配置方式: 4 | 5 | pattern accept://mime-type 6 | 7 | pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 8 | 9 | 例子: 10 | 11 | 只接受图片类型的数据 12 | 13 | www.test.com accept://image/* 14 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/attachment.md: -------------------------------------------------------------------------------- 1 | # attachment 2 | 3 | 设置响应头字段,让响应变成可以直接下载,配置方式: 4 | 5 | pattern attachment://filename 6 | 7 | filname指定下载文件保存的名称,如果filename为空,则会自动获取url对应的文件名称,如果url没有对应的文件名称,则默认为`index.html` 8 | 9 | 例子: 10 | 11 | www.ifeng.com attachment://ifeng.html 12 | 13 | 访问[www.ifeng.com](http://www.ifeng.com/)时会自动下载该页面。 14 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/auth.md: -------------------------------------------------------------------------------- 1 | # auth 2 | 修改请求头的`authorization`字段,这个字段是网页401弹出的输入框中输入用户名和密码的Base64编码,配置方式: 3 | 4 | pattern auth://username:password 5 | 6 | # 或者采用json格式 7 | pattern auth://filepath 8 | 9 | filepath为[Values](http://local.whistlejs.com/#values)里面的{key}或者本地文件(如:`e:\test\xxx`、`e:/test/xxx`、`/User/username/test/xxx`等): 10 | 11 | username: xxx 12 | password: ooo 13 | 14 | pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html),json格式参考[操作值](../data.html)。 15 | 16 | 例子: 17 | 18 | www.ifeng.com auth://test:123 19 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/cache.md: -------------------------------------------------------------------------------- 1 | # cache 2 | 设置响应的缓存头,配置方式: 3 | 4 | pattern cache://maxAge 5 | 6 | maxAge为缓存的秒数,也可以代表一些关键字: `no`、`no-cache`、`no-store`,pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 7 | 8 | 例子: 9 | 10 | # 去除缓存 11 | www.ifeng.com cache://no 12 | 13 | # 设置一分钟的缓存 14 | www.ifeng.com cache://60 15 | 16 | 17 | 如果如果后台返回304设置这个字段没有用,要防止后台返回`304`,需要用[disable](disable.html)://cache。 18 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/css.md: -------------------------------------------------------------------------------- 1 | # css 2 | > `v1.8.0` 及以后的版本用 [cssAppend](./cssAppend.html) 代替 3 | 4 | 往content-type为html或css的响应内容后面追加数据,如果是html,则会自动加上 style 标签在追加到响应内容,如果是css,则会自动追加到文本后面,这个与[resAppend](resAppend.html)的区别是[resAppend](resAppend.html)不区分类型,对所有匹配的响应都会追加指定的数据,配置方式: 5 | 6 | pattern css://filepath 7 | 8 | filepath为[Values](http://local.whistlejs.com/#values)里面的{key}或者本地文件(如:`e:\test\xxx`、`e:/test/xxx`、`/User/username/test/xxx`等),pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 9 | 10 | 例子: 11 | 12 | www.ifeng.com css://{test.css} 13 | 14 | test.css: 15 | 16 | html, body {background: red!important;} 17 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/cssAppend.md: -------------------------------------------------------------------------------- 1 | # cssAppend 2 | 3 | 往content-type为html或css的响应内容后面追加数据,如果是html,则会自动加上 style 标签在追加到响应内容,如果是css,则会自动追加到文本后面,这个与[resAppend](resAppend.html)的区别是[resAppend](resAppend.html)不区分类型,对所有匹配的响应都会追加指定的数据,配置方式: 4 | 5 | pattern cssAppend://filepath 6 | 7 | filepath为[Values](http://local.whistlejs.com/#values)里面的{key}或者本地文件(如:`e:\test\xxx`、`e:/test/xxx`、`/User/username/test/xxx`等),pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 8 | 9 | 例子: 10 | 11 | www.ifeng.com cssAppend://{test.css} 12 | 13 | test.css: 14 | 15 | html, body {background: red!important;} 16 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/cssBody.md: -------------------------------------------------------------------------------- 1 | # cssBody 2 | 3 | 替换content-type为html或css的响应内容,如果是html,则会自动加上 style 标签在替换响应内容,如果是css,则替换整个css文件,这个与[resBody](resBody.html)的区别是[resBody](resBody.html)不区分类型,对所有匹配的响应都会执行替换数据,配置方式: 4 | 5 | pattern cssBody://filepath 6 | 7 | filepath为[Values](http://local.whistlejs.com/#values)里面的{key}或者本地文件(如:`e:\test\xxx`、`e:/test/xxx`、`/User/username/test/xxx`等),pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 8 | 9 | 例子: 10 | 11 | www.ifeng.com cssBody://{test.css} 12 | 13 | test.css: 14 | 15 | html, body {background: red!important;} 16 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/cssPrepend.md: -------------------------------------------------------------------------------- 1 | # cssPrepend 2 | 3 | 往content-type为html或css的响应内容前面追加数据,如果是html,则会自动加上 style 标签再追加到响应内容前面,如果是css,则会自动追加到文本前面,这个与[resPrepend](resPrepend.html)的区别是[resPrepend](resPrepend.html)不区分类型,对所有匹配的响应都会追加指定的数据,配置方式: 4 | 5 | pattern cssPrepend://filepath 6 | 7 | filepath为[Values](http://local.whistlejs.com/#values)里面的{key}或者本地文件(如:`e:\test\xxx`、`e:/test/xxx`、`/User/username/test/xxx`等),pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 8 | 9 | 例子: 10 | 11 | www.ifeng.com cssPrepend://{test.css} 12 | 13 | test.css: 14 | 15 | html, body {background: red!important;} 16 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/delete.md: -------------------------------------------------------------------------------- 1 | # delete 2 | 3 | 删除指定的请求响应头字段,也可以通过[reqHeaders](reqHeaders.html)、[resHeaders](resHeaders.html)把字段设置为空字符串,配置方式: 4 | 5 | pattern delete://req.headers.xxx|req.headers.x22|res.headers.yyy|headers.zzz 6 | 7 | pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 8 | 9 | 其中: 10 | 11 | 1. `req.headers.xxx`: 删除req.headers的xxx字段 12 | 2. `res.headers.xxx`: 删除res.headers的xxx字段 13 | 3. `headers.xxx`: 删除res.headers&res.headers的xxx字段 14 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/enable.md: -------------------------------------------------------------------------------- 1 | # enable 2 | 通过配置开启指定的设置(https拦截、隐藏请求),配置方式(v1.2.5及以上版本支持): 3 | 4 | pattern enable://https|intercept|hide|abort 5 | 6 | 其中,`https`或`intercept`表示拦截pattern匹配的tunnel请求(如果是https或wss请求需要安装whistle的根证书:[点击这里](../webui/https.html),拦截后可以查看https请求的具体内容);`hide`表示隐藏pattern匹配的所有请求,将不显示在[Network](../webui/network.html)上;通过`|`可以同时设置多个操作。 7 | 8 | 例子: 9 | 10 | # 拦截url里面有baidu的https请求 11 | /baidu/ enable://intercept 12 | 13 | # 拦截域名www.google.com下的所有https请求,且不在Network上显示 14 | www.google.com enable://intercept|hide 15 | 16 | # abort掉请求(v1.5.17+) 17 | www.xiaoying.com enable://abort 18 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/etag.md: -------------------------------------------------------------------------------- 1 | # etag 2 | 3 | 修改请求头的etag字段,配置方式: 4 | 5 | pattern etag://etagValue 6 | 7 | pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 8 | 9 | 例子: 10 | 11 | # 删除etag 12 | www.ifeng.com etag:// 13 | 14 | # etag修改为xxx 15 | www.ifeng.com etag://xxx 16 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/forwardedFor.md: -------------------------------------------------------------------------------- 1 | # forwardedFor 2 | 3 | 修改请求头的 `x-forwarded-for` 字段(`whistle >= v1.6.1`),配置方式: 4 | 5 | pattern forwardedFor://ip 6 | 7 | pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 8 | 9 | 例子: 10 | 11 | # 修改www.ifeng.com请求头的`x-forwarded-for` 字段为 1.1.1.1 12 | www.ifeng.com forwardedFor://1.1.1.1 13 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/hostname.md: -------------------------------------------------------------------------------- 1 | # hostname 2 | 修改请求头的host字段,后台server会根据请求头的host字段来判断请的域名,一般情况下无需修改采用默认的即可,但在调试阶段可能会涉及到host里面有端口的问题,则可以用hostname这个协议来去除端口(最好的方式还是采用配置带端口号的[host](host.html))。 3 | 4 | 配置方式: 5 | 6 | pattern hostname://newHostname 7 | 8 | pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 9 | 10 | 例子: 11 | 12 | www.test.com:8888 hostname://www.test.com 13 | 14 | 去掉www.test.com:8888所有请求头部host字段的端口号。 15 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/html.md: -------------------------------------------------------------------------------- 1 | # html 2 | > `v1.8.0` 及以后使用[jsAppend](./jsAppend.html)代替 3 | 4 | 往content-type为html的响应内容后面追加数据,这个与[resAppend](resAppend.html)的区别是[resAppend](resAppend.html)不区分类型,对所有匹配的响应都会追加指定的数据,配置方式: 5 | 6 | pattern html://filepath 7 | 8 | filepath为[Values](http://local.whistlejs.com/#values)里面的{key}或者本地文件(如:`e:\test\xxx`、`e:/test/xxx`、`/User/username/test/xxx`等),pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 9 | 10 | 例子: 11 | 12 | www.ifeng.com html://{test.html} 13 | 14 | test.html: 15 | 16 | 17 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/htmlAppend.md: -------------------------------------------------------------------------------- 1 | # htmlAppend 2 | 3 | 往content-type为html的响应内容后面追加数据,这个与[resAppend](resAppend.html)的区别是[resAppend](resAppend.html)不区分类型,对所有匹配的响应都会追加指定的数据,配置方式: 4 | 5 | pattern htmlAppend://filepath 6 | 7 | filepath为[Values](http://local.whistlejs.com/#values)里面的{key}或者本地文件(如:`e:\test\xxx`、`e:/test/xxx`、`/User/username/test/xxx`等),pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 8 | 9 | 例子: 10 | 11 | www.ifeng.com htmlAppend://{test.html} 12 | 13 | test.html: 14 | 15 | 16 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/htmlBody.md: -------------------------------------------------------------------------------- 1 | # htmlBody 2 | 3 | 替换content-type为html的响应内容,这个与[resBody](resBody.html)的区别是[resBody](resBody.html)不区分类型,对所有匹配的响应都会替换,配置方式: 4 | 5 | pattern htmlBody://filepath 6 | 7 | filepath为[Values](http://local.whistlejs.com/#values)里面的{key}或者本地文件(如:`e:\test\xxx`、`e:/test/xxx`、`/User/username/test/xxx`等),pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 8 | 9 | 例子: 10 | 11 | www.ifeng.com htmlBody://{test.html} 12 | 13 | test.html: 14 | 15 | 16 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/htmlPrepend.md: -------------------------------------------------------------------------------- 1 | # htmlPrepend 2 | 3 | 往content-type为html的响应内容前面添加数据,这个与[resPrepend](resPrepend.html)的区别是[resPrepend](resPrepend.html)不区分类型,对所有匹配的响应都会在前面添加指定的数据,配置方式: 4 | 5 | pattern htmlPrepend://filepath 6 | 7 | filepath为[Values](http://local.whistlejs.com/#values)里面的{key}或者本地文件(如:`e:\test\xxx`、`e:/test/xxx`、`/User/username/test/xxx`等),pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 8 | 9 | 例子: 10 | 11 | www.ifeng.com htmlPrepend://{test.html} 12 | 13 | test.html: 14 | 15 | 16 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/js.md: -------------------------------------------------------------------------------- 1 | # js 2 | > `v1.8.0` 及以后的版本用 [jsAppend](./jsAppend.html) 代替 3 | 4 | 往content-type为html或js的响应内容后面追加数据,如果是html,则会自动加上 script 标签在追加到响应内容,如果是js,则会自动追加到js文本后面,这个与[resAppend](resAppend.html)的区别是[resAppend](resAppend.html)不区分类型,对所有匹配的响应都会追加指定的数据,配置方式: 5 | 6 | pattern js://filepath 7 | 8 | filepath为[Values](http://local.whistlejs.com/#values)里面的{key}或者本地文件(如:`e:\test\xxx`、`e:/test/xxx`、`/User/username/test/xxx`等),pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 9 | 10 | 例子: 11 | 12 | www.ifeng.com js://{test.js} 13 | 14 | test.js: 15 | 16 | alert(2); 17 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/jsAppend.md: -------------------------------------------------------------------------------- 1 | # js 2 | 3 | 往content-type为html或js的响应内容后面追加数据,如果是html,则会自动加上 script 标签在追加到响应内容,如果是js,则会自动追加到js文本后面,这个与[resAppend](resAppend.html)的区别是[resAppend](resAppend.html)不区分类型,对所有匹配的响应都会追加指定的数据,配置方式: 4 | 5 | pattern js://filepath 6 | 7 | filepath为[Values](http://local.whistlejs.com/#values)里面的{key}或者本地文件(如:`e:\test\xxx`、`e:/test/xxx`、`/User/username/test/xxx`等),pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 8 | 9 | 例子: 10 | 11 | www.ifeng.com js://{test.js} 12 | 13 | test.js: 14 | 15 | alert(2); 16 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/jsBody.md: -------------------------------------------------------------------------------- 1 | # jsBody 2 | 3 | 替换往content-type为html或js的响应内容,如果是html,则会自动加上 script 标签再替换响应内容,如果是js,则会自动替换整个js文件,这个与[resBody](resBody.html)的区别是[resAppend](resBody.html)不区分类型,对所有匹配的响应都会追加指定的数据,配置方式: 4 | 5 | pattern jsBody://filepath 6 | 7 | filepath为[Values](http://local.whistlejs.com/#values)里面的{key}或者本地文件(如:`e:\test\xxx`、`e:/test/xxx`、`/User/username/test/xxx`等),pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 8 | 9 | 例子: 10 | 11 | www.ifeng.com jsBody://{test.js} 12 | 13 | test.js: 14 | 15 | alert(2); 16 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/jsPrepend.md: -------------------------------------------------------------------------------- 1 | # jsPrepend 2 | 3 | 往content-type为html或js的响应内容前面添加数据,如果是html,则会自动加上 script 标签再添加到响应内容前面,如果是js,则会自动添加到响应内容前面,这个与[jsPrepend](jsPrepend.html)的区别是[jsPrepend](jsPrepend.html)不区分类型,对所有匹配的响应都会追加指定的数据,配置方式: 4 | 5 | pattern jsPrepend://filepath 6 | 7 | filepath为[Values](http://local.whistlejs.com/#values)里面的{key}或者本地文件(如:`e:\test\xxx`、`e:/test/xxx`、`/User/username/test/xxx`等),pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 8 | 9 | 例子: 10 | 11 | www.ifeng.com jsPrepend://{test.js} 12 | 13 | test.js: 14 | 15 | alert(2); 16 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/log.md: -------------------------------------------------------------------------------- 1 | # log 2 | 3 | 可以用来自动监控html页面或js文件出现的错误及显示console.xxx打印出来的信息,这些错误及日志会自动打印在whistle界面的log平台,还可以自动嵌入自定义的脚本调试页面。 4 | 5 | 支持的console方法有(支持所有浏览器): console.log, console.debug, console.info, console.warn. console.error, console.fatal。 6 | 7 | 配置方式: 8 | 9 | pattern log://filepath 10 | 11 | filepath为[Values](http://local.whistlejs.com/#values)里面的{key}或者本地文件的js脚本(如:`e:\test\xxx`、`e:/test/xxx`、`/User/username/test/xxx`等),pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 12 | 13 | 例子: 14 | 15 | www.ifeng.com log://{test.js} 16 | 17 | [Values](http://local.whistlejs.com/#values)里面的`test.js`分组内容: 18 | 19 | console.log(1, 2, 3, {abc: 123}); 20 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/method.md: -------------------------------------------------------------------------------- 1 | 2 | # method 3 | 修改请求方法,配置方式: 4 | 5 | pattern method://newMethod 6 | 7 | pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 8 | 9 | 例子: 10 | 11 | 12 | www.ifeng.com method://post -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/pac.md: -------------------------------------------------------------------------------- 1 | 2 | # pac 3 | 设置pac脚本,配置方式: 4 | 5 | pattern pac://filepath 6 | 7 | filepath为[Values](http://local.whistlejs.com/#values)里面的{key}或者本地文件(如:`e:\test\xxx`、`e:/test/xxx`、`/User/username/test/xxx`等)或http(s)链接,pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 8 | 9 | 例子: 10 | 11 | 12 | /./ pac://https://raw.githubusercontent.com/imweb/node-pac/master/test/scripts/normal.pac -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/proxy.md: -------------------------------------------------------------------------------- 1 | # proxy 2 | 3 | 设置http代理,配置方式: 4 | 5 | pattern proxy://ip:port 6 | 7 | # 加用户名密码 8 | pattern proxy://username:password@ip:port 9 | 10 | pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 11 | 12 | 13 | 例子: 14 | 15 | 把所有请求代理到`127.0.0.1:8888`的代理服务器: 16 | 17 | /./ proxy://127.0.0.1:8888 18 | www.facebook.com proxy://test:123@127.0.0.1:8888 19 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/redirect.md: -------------------------------------------------------------------------------- 1 | # redirect 2 | 3 | 设置302调整,配置方式: 4 | 5 | pattern redirect://jumpUrl 6 | 7 | jumpUrl为请求要302跳转的目标url,pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 8 | 9 | 10 | 例子: 11 | 12 | www.ifeng.com redirect://http://www.aliexpress.com/ 13 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/referer.md: -------------------------------------------------------------------------------- 1 | 2 | # referer 3 | 4 | 修改请求头的referer字段,有些服务器会校验请求头的referer字段,这个协议可以用来绕过这个检测或者测试后台的功能,配置方式: 5 | 6 | pattern referer://url 7 | 8 | pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 9 | 10 | 例子: 11 | 12 | 如果我们在www.test.com域名的页面中发www.aliexpress.com的请求,则请求头的referer为www.test.com域名下的url或为空,这样可能请求到后台会返回403,可以这么修改referer: 13 | 14 | www.aliexpress.com referer://http://www.aliexpress.com 15 | 16 | 把www.aliexpress.com域名下的请求都加上`http://www.aliexpress.com`这个referer。 17 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/replaceStatus.md: -------------------------------------------------------------------------------- 1 | 2 | # replaceStatus 3 | 4 | 替换响应的状态码(状态码范围100~999),这个与[statusCode](statusCode.html)的区别是,replaceStatus是请求响应后再修改状态码,而后者的请求不会发出去,设置完状态码直接返回,配置方式: 5 | 6 | pattern replaceStatus://code 7 | 8 | 其中:code >= 100 && code <= 999,pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 9 | 10 | 11 | 例子: 12 | 13 | www.ifeng.com replaceStatus://500 -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/reqAppend.md: -------------------------------------------------------------------------------- 1 | # reqAppend 2 | 3 | 把指定的内容追加到请求内容后面(GET等请求没有内容无法追加),配置方式: 4 | 5 | pattern reqAppend://filepath 6 | 7 | filepath为[Values](http://local.whistlejs.com/#values)里面的{key}或者本地文件(如:`e:\test\xxx`、`e:/test/xxx`、`/User/username/test/xxx`等): 8 | 9 | Append body 10 | 11 | pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 12 | 13 | 例子: 14 | 15 | www.ifeng.com method://post reqAppend://{test-reqAppend.html} 16 | 17 | 18 | test-reqAppend.html: 19 | 20 | Append body 21 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/reqBody.md: -------------------------------------------------------------------------------- 1 | # reqBody 2 | 3 | 把指定的内容替换请求内容(GET等请求没有内容没有替换一说),配置方式: 4 | 5 | pattern reqBody://filepath 6 | 7 | filepath为[Values](http://local.whistlejs.com/#values)里面的{key}或者本地文件(如:`e:\test\xxx`、`e:/test/xxx`、`/User/username/test/xxx`等): 8 | 9 | Body body 10 | 11 | pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 12 | 13 | 例子: 14 | 15 | www.ifeng.com method://post reqBody://{test-reqBody.html} 16 | 17 | 18 | test-reqBody.html: 19 | 20 | Body body 21 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/reqCharset.md: -------------------------------------------------------------------------------- 1 | # reqCharset 2 | 修改请求头`content-type`的charset,配置方式: 3 | 4 | pattern reqCharset://charset 5 | 6 | charset可以为`utf8`、`gbk`等等字符编码,pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html) 7 | 8 | 例子: 9 | 10 | www.ifeng.com reqCharset://utf8 11 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/reqCookies.md: -------------------------------------------------------------------------------- 1 | 2 | # reqCookies 3 | 修改请求的cookie,配置方式: 4 | 5 | pattern reqCookies://filepath 6 | 7 | filepath为[Values](http://local.whistlejs.com/#values)里面的{key}或者本地文件(如:`e:\test\xxx`、`e:/test/xxx`、`/User/username/test/xxx`等): 8 | 9 | key1: value1 10 | key2: value2 11 | keyN: valueN 12 | 13 | pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html),json格式参考[操作值](../data.html)。 14 | 15 | 例子: 16 | 17 | www.ifeng.com reqCookies://{test-reqCookies.json} 18 | 19 | 20 | test-reqCookies.json: 21 | 22 | test: 123 23 | key: value 24 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/reqCors.md: -------------------------------------------------------------------------------- 1 | # reqCors 2 | 3 | 修改请求的[cors](https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Access_control_CORS),配置方式: 4 | 5 | pattern reqCors://filepath 6 | 7 | filepath为[Values](http://local.whistlejs.com/#values)里面的{key}或者本地文件(如:`e:\test\xxx`、`e:/test/xxx`、`/User/username/test/xxx`等): 8 | 9 | origin: * 10 | method: POST 11 | headers: x-test 12 | 13 | pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html),json格式参考[操作值](../data.html)。 14 | 15 | 例子: 16 | 17 | www.ifeng.com reqCors://{test-reqCors.json} 18 | 19 | 20 | test-reqCors.json: 21 | 22 | origin: * 23 | method: POST 24 | headers: x-test 25 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/reqDelay.md: -------------------------------------------------------------------------------- 1 | # reqDelay 2 | 3 | 设置延迟请求的时间(单位:毫秒),配置方式: 4 | 5 | pattern reqDelay://timeMS 6 | 7 | pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 8 | 9 | 例子: 10 | 11 | www.ifeng.com reqDelay://3000 12 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/reqHeaders.md: -------------------------------------------------------------------------------- 1 | # reqHeaders 2 | 3 | 修改请求头,配置方式: 4 | 5 | pattern reqHeaders://filepath 6 | 7 | filepath为[Values](http://local.whistlejs.com/#values)里面的{key}或者本地文件(如:`e:\test\xxx`、`e:/test/xxx`、`/User/username/test/xxx`等): 8 | 9 | x-test1: value1 10 | x-test2: value2 11 | x-testN: valueN 12 | 13 | pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html),json格式参考[操作值](../data.html)。 14 | 15 | 例子: 16 | 17 | www.ifeng.com reqHeaders://{test-reqHeaders.json} 18 | 19 | 20 | test-reqHeaders.json: 21 | 22 | x-test1: value1 23 | x-test2: value2 24 | x-testN: valueN 25 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/reqPrepend.md: -------------------------------------------------------------------------------- 1 | # reqPrepend 2 | 3 | 把指定的内容添加到请求内容前面(GET等请求没有内容无法添加),配置方式: 4 | 5 | pattern reqPrepend://filepath 6 | 7 | filepath为[Values](http://local.whistlejs.com/#values)里面的{key}或者本地文件(如:`e:\test\xxx`、`e:/test/xxx`、`/User/username/test/xxx`等): 8 | 9 | Prepend body 10 | 11 | pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 12 | 13 | 例子: 14 | 15 | www.ifeng.com method://post reqPrepend://{test-reqPrepend.html} 16 | 17 | 18 | test-reqPrepend.html: 19 | 20 | Prepend body 21 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/reqSpeed.md: -------------------------------------------------------------------------------- 1 | # reqSpeed 2 | 3 | 设置请求速度(单位:kb/s,千比特/每秒),配置方式: 4 | 5 | pattern reqSpeed://kbs 6 | 7 | pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 8 | 9 | 例子: 10 | 11 | www.ifeng.com reqSpeed://3 12 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/reqType.md: -------------------------------------------------------------------------------- 1 | # reqType 2 | 修改请求头的`content-type`,配置方式: 3 | 4 | pattern reqType://mimeType 5 | 6 | pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html),mimeType为新的`content-type`,如:`text/plain`、`text/html`、`image/png`等等,还有一些关键字,whistle会自动把它转成对应的type: 7 | 8 | urlencoded: application/x-www-form-urlencoded 9 | form: application/x-www-form-urlencoded 10 | json: application/json 11 | xml: text/xml 12 | text: text/plain 13 | upload: multipart/form-data 14 | multipart: multipart/form-data 15 | defaultType: application/octet-stream 16 | 17 | 例子: 18 | 19 | www.ifeng.com reqType://text 20 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/reqWrite.md: -------------------------------------------------------------------------------- 1 | # reqWrite 2 | 将请求的内容(如果请求方法允许携带内容)写入的指定的文件夹或文件;whistle会根据请求的url和配置自动拼接成路径,且whistle不会覆盖已存在的文件,配置方式: 3 | 4 | pattern reqWrite://filepath 5 | 6 | filepath为本地目录或文件,pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 7 | 8 | 例子: 9 | 10 | # 匹配http://www.ifeng.com/,指定特定的文件 11 | /^http:\/\/www.ifeng.com\/$/ reqWrite:///User/test/index.html 12 | www.ifeng.com reqWrite:///User/test 13 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/reqWriteRaw.md: -------------------------------------------------------------------------------- 1 | # reqWriteRaw 2 | 将请求的完整内容(包括请求方法、路径、协议、请求头、内容)写入的指定的文件夹或文件;whistle会根据请求的url和配置自动拼接成路径,且whistle不会覆盖已存在的文件,配置方式: 3 | 4 | pattern reqWriteRaw://filepath 5 | 6 | filepath为本地目录或文件,pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 7 | 8 | 例子: 9 | 10 | # 匹配http://www.ifeng.com/,指定特定的文件 11 | /^http:\/\/www.ifeng.com\/$/ reqWriteRaw:///User/test/index.html 12 | www.ifeng.com reqWriteRaw:///User/test 13 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/resAppend.md: -------------------------------------------------------------------------------- 1 | # resAppend 2 | 3 | 把指定的内容追加到响应内容后面(304等响应没有内容无法追加),配置方式: 4 | 5 | pattern resAppend://filepath 6 | 7 | filepath为[Values](http://local.whistlejs.com/#values)里面的{key}或者本地文件(如:`e:\test\xxx`、`e:/test/xxx`、`/User/username/test/xxx`等): 8 | 9 | Append body 10 | 11 | pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 12 | 13 | 例子: 14 | 15 | www.ifeng.com resAppend://{test-resAppend.html} 16 | 17 | 18 | test-resAppend.html: 19 | 20 | Append body 21 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/resBody.md: -------------------------------------------------------------------------------- 1 | # resBody 2 | 3 | 把指定的内容替换响应内容(304等响应没有内容无法替换),配置方式: 4 | 5 | pattern resBody://filepath 6 | 7 | filepath为[Values](http://local.whistlejs.com/#values)里面的{key}或者本地文件(如:`e:\test\xxx`、`e:/test/xxx`、`/User/username/test/xxx`等): 8 | 9 | Body body 10 | 11 | pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 12 | 13 | 例子: 14 | 15 | www.ifeng.com resBody://{test-resBody.html} 16 | 17 | 18 | test-resBody.html: 19 | 20 | Body body 21 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/resCharset.md: -------------------------------------------------------------------------------- 1 | # resCharset 2 | 修改响应头`content-type`的charset,配置方式: 3 | 4 | pattern resCharset://charset 5 | 6 | charset可以为`utf8`、`gbk`等等字符编码,pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html) 7 | 8 | 例子: 9 | 10 | www.ifeng.com resCharset://utf8 11 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/resDelay.md: -------------------------------------------------------------------------------- 1 | # resDelay 2 | 3 | 设置延迟响应的时间(单位:毫秒),配置方式: 4 | 5 | pattern resDelay://timeMS 6 | 7 | pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 8 | 9 | 例子: 10 | 11 | www.ifeng.com resDelay://3000 12 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/resHeaders.md: -------------------------------------------------------------------------------- 1 | # resHeaders 2 | 3 | 修改请求头,配置方式: 4 | 5 | pattern resHeaders://filepath 6 | 7 | filepath为[Values](http://local.whistlejs.com/#values)里面的{key}或者本地文件(如:`e:\test\xxx`、`e:/test/xxx`、`/User/username/test/xxx`等): 8 | 9 | x-test1: value1 10 | x-test2: value2 11 | x-testN: valueN 12 | 13 | pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html),json格式参考[操作值](../data.html)。 14 | 15 | 例子: 16 | 17 | www.ifeng.com resHeaders://{test-resHeaders.json} 18 | 19 | 20 | test-resHeaders.json: 21 | 22 | x-test1: value1 23 | x-test2: value2 24 | x-testN: valueN 25 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/resPrepend.md: -------------------------------------------------------------------------------- 1 | # resPrepend 2 | 3 | 把指定的内容添加到响应内容前面(304等响应没有内容无法添加),配置方式: 4 | 5 | pattern resPrepend://filepath 6 | 7 | filepath为[Values](http://local.whistlejs.com/#values)里面的{key}或者本地文件(如:`e:\test\xxx`、`e:/test/xxx`、`/User/username/test/xxx`等): 8 | 9 | Prepend body 10 | 11 | pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 12 | 13 | 例子: 14 | 15 | www.ifeng.com resPrepend://{test-resPrepend.html} 16 | 17 | 18 | test-resPrepend.html: 19 | 20 | Prepend body 21 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/resReplace.md: -------------------------------------------------------------------------------- 1 | # resReplace 2 | 3 | 类似js字符串的replace方法,利用正则或字符串来匹配替换响应文本内容(响应的content-type必须文本类型:html、json、xml、text等),配置方式: 4 | 5 | pattern resReplace://filepath 6 | 7 | filepath为[Values](http://local.whistlejs.com/#values)里面的{key}或者本地文件(如:`e:\test\xxx`、`e:/test/xxx`、`/User/username/test/xxx`等): 8 | 9 | /user=([^&])/ig: user=$1$1 10 | str: replacement 11 | 12 | pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html),json格式参考[操作值](../data.html)。 13 | 14 | 例子: 15 | 16 | www.ifeng.com resReplace://{test-resReplace.json} 17 | 18 | 19 | test-resReplace.json: 20 | 21 | /user=([^&])/ig: user=$1$1 22 | = v1.7.1`),主要方便自定义whistle的Network SeverIP显示真实的服务器环境或IP,配置方式: 4 | 5 | pattern responseFor://env 6 | 7 | pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 8 | 9 | 例子: 10 | 11 | # 修改www.ifeng.com请求头的`x-whistle-response-for` 字段为 1.1.1.1 12 | www.ifeng.com responseFor://1.1.1.1 13 | 14 | 15 | PS:某些情况下需要通过nigix转发,可以结合[resScript](./resScript.html)把响应头的`x-upstream`字段设置到`x-whistle-response-for`,这样就可以在whistle的Network上看到真实的IP 16 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/rule/README.md: -------------------------------------------------------------------------------- 1 | # 响应规则列表 2 | 3 | 1. [**请求替换**](replace.html) 4 | 1. [**file** (替换本地文件)](file.html) 5 | 1. [**xfile** (替换本地文件,如果本地文件不存在,则请求线上)](file.html) 6 | 1. [**rawfile** (替换本地http响应内容格式的文件)](rawfile.html) 7 | 1. [**xrawfile** (替换本地http响应内容格式的文件,如果本地文件不存在,则请求线上)](rawfile.html) 8 | 1. [**tpl** (替换本地目标文件,可用于模拟jsonp请求)](tpl.html) 9 | 1. [**xtpl** (同上,与xfile类似)](tpl.html) 10 | 1. [**自定义**](custom.html) 11 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/rule/custom.md: -------------------------------------------------------------------------------- 1 | # 自定义规则 2 | 3 | whistle提供了插件的方式扩展协议,具体参考:[插件开发](../../plugins.html) -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/rule/replace.md: -------------------------------------------------------------------------------- 1 | # 请求替换 2 | 3 | 把请求替换成请求其它url,配置方式: 4 | 5 | pattern http://host:port/xxx 6 | pattern https://host:port/xxx 7 | 8 | # 自动补充协议(与请求的协议一样) 9 | pattern host:port/xxx 10 | 11 | 其中,pattern参见[匹配模式](../../pattern.html),更多模式请参考[配置方式](../../mode.html)。 12 | 13 | 例子: 14 | 15 | 把[www.ifeng.com](http://www.ifeng.com/)域名下的请求全部替换成www.aliexpress.com的请求: 16 | 17 | www.ifeng.com www.aliexpress.com 18 | 19 | 用[http://www.ifeng.com](http://www.ifeng.com/)访问HTTPS的[https://www.baidu.com](https://www.baidu.com/) 20 | 21 | http://www.ifeng.com https://www.baidu.com 22 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/rule/tpl.md: -------------------------------------------------------------------------------- 1 | # tpl (xtpl) 2 | 3 | __xtpl功能同tpl一样,和tpl的唯一区别是tpl找不到对应文件返回404,而xtpl则是继续请求线上资源。__ 4 | 5 | 6 | tpl基本功能跟[file](file.html)一样可以做本地替换,但tpl内置了一个简单的模板引擎,可以把文件内容里面`{name}`替换请求参数对应的字段(如果不存在对应的自动则不会进行替换),一般可用于mock jsonp的请求。 7 | 8 | 配置方式: 9 | 10 | pattern tpl://filepath 11 | # 也可以匹配一个文件或目录路径列表,whistle会依次查找直到找到存在的文件 12 | pattern tpl://path1|path2|pathN 13 | 14 | filepath为[Values](http://local.whistlejs.com/#values)里面的{key}或者本地文件。 15 | 16 | 17 | 例子: 18 | 19 | /\.jsonp/i tpl://{test.json} 20 | 21 | test.json: 22 | 23 | {callback}({ec: 0}) 24 | 25 | 请求 `http://www.test.com/test/xxx.jsonp?callback=imcallbackfn` 会返回 `imcallbackfn({ec: 0})` 26 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/rule/xfile.md: -------------------------------------------------------------------------------- 1 | 2 | # xfile 3 | 4 | __xfile功能同file一样,xfile和file的唯一区别是file找不到对应文件返回404,而xfile则是继续请求线上资源。__ 5 | 6 | 7 | 用法参考 [file](file.html) 8 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/rule/xrawfile.md: -------------------------------------------------------------------------------- 1 | # xrawfile 2 | 3 | __xrawfile功能同rawfile一样,和rawfile的唯一区别是rawfile找不到对应文件返回404,而xrawfile则是继续请求线上资源。__ 4 | 5 | 用法参考 [rawfile](rawfile.html) 6 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/rule/xtpl.md: -------------------------------------------------------------------------------- 1 | # xtpl 2 | 3 | __xtpl功能同tpl一样,和tpl的唯一区别是tpl找不到对应文件返回404,而xtpl则是继续请求线上资源。__ 4 | 5 | 6 | 用法参考 [tpl](tpl.html) 7 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/socks.md: -------------------------------------------------------------------------------- 1 | # socks 2 | 3 | 设置socks代理,配置方式: 4 | 5 | pattern socks://ip:port 6 | 7 | # 加用户名密码 8 | pattern socks://username:password@ip:port 9 | 10 | pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 11 | 12 | 13 | 例子: 14 | 15 | 把所有请求代理到`127.0.0.1:8888`的代理服务器: 16 | 17 | /./ socks://127.0.0.1:1080 18 | www.facebook.com socks://test:123@127.0.0.1:1080 19 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/statusCode.md: -------------------------------------------------------------------------------- 1 | # statusCode 2 | 3 | 设置响应状态码(状态码范围`100~999`),请求会直接根据设置的状态码返回,不会请求到线上,这个与[replaceStatus](replaceStatus.html)不同,后者是请求返回后再修改状态码,可以用于模拟各种状态码,配置方式: 4 | 5 | pattern statusCode://code 6 | 7 | 其中:code >= 100 && code <= 999,pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html)。 8 | 9 | 10 | 例子: 11 | 12 | www.ifeng.com statusCode://500 13 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/ua.md: -------------------------------------------------------------------------------- 1 | # ua 2 | 3 | 修改请求头的`user-agent`字段,可用于模拟各种机器访问,配置方式: 4 | 5 | pattern ua://newUA 6 | 7 | newUA为新的ua字符串(中间不能有空格)或者[Values](http://local.whistlejs.com/#values)里面的{key}。 8 | 9 | 例子: 10 | 11 | www.ifeng.com ua://Mozilla/5.0 12 | 13 | # 把完整UA存在Values里面 14 | www.ifeng.com ua://{test-ua} 15 | 16 | test-ua: 17 | 18 | Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.23 Mobile Safari/537.36 19 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/urlParams.md: -------------------------------------------------------------------------------- 1 | # urlParams 2 | 3 | 修改请求参数,配置方式: 4 | 5 | pattern urlParams://filepath 6 | 7 | filepath为[Values](http://local.whistlejs.com/#values)里面的{key}或者本地文件(如:`e:\test\xxx`、`e:/test/xxx`、`/User/username/test/xxx`等): 8 | 9 | field1: value1 10 | field2: value2 11 | filedN: valueN 12 | 13 | pattern参见[匹配模式](../pattern.html),更多模式请参考[匹配模式](../mode.html),json格式参考[操作值](../data.html)。 14 | 15 | 例子: 16 | 17 | www.ifeng.com urlParams://(test=1) 18 | 19 | 括号的写法见:[Rules的特殊操作符({}、()、<>)](../webui/rules.html) 20 | -------------------------------------------------------------------------------- /vendor/whistle/docs/en/rules/urlReplace.md: -------------------------------------------------------------------------------- 1 | # urlReplace 2 | 3 | 类似js字符串的replace方法,利用正则或字符串来匹配替换请求url的path部分(如`http://www.test.com/xxx?xxx`,只能替换url中`xxx?xxx`这部分的内容),配置方式: 4 | 5 | pattern urlReplace://filepath 6 | 7 | filepath为[Values](http://local.whistlejs.com/#values)里面的{key}或者本地文件(如:`e:\test\xxx`、`e:/test/xxx`、`/User/username/test/xxx`等): 8 | 9 | /user=([^&])/ig: user=$1$1 10 | str: replacement 11 | 12 | pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html),json格式参考[操作值](../data.html)。 13 | 14 | 例子: 15 | 16 | www.ifeng.com urlReplace://{test-resReplace.json} 17 | 18 | 19 | test-urlReplace.json: 20 | 21 | /user=([^&])/ig: user=$1$1 22 | index: news 23 | -------------------------------------------------------------------------------- /vendor/whistle/docs/new-docs/.vuepress/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/new-docs/.vuepress/public/favicon.ico -------------------------------------------------------------------------------- /vendor/whistle/docs/new-docs/.vuepress/public/host01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/new-docs/.vuepress/public/host01.png -------------------------------------------------------------------------------- /vendor/whistle/docs/new-docs/README.md: -------------------------------------------------------------------------------- 1 | 2 | 17 | English Documentation 18 | 中文文档 -------------------------------------------------------------------------------- /vendor/whistle/docs/new-docs/assets/download-rootca.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/new-docs/assets/download-rootca.jpg -------------------------------------------------------------------------------- /vendor/whistle/docs/new-docs/assets/proxy-mac.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/new-docs/assets/proxy-mac.jpg -------------------------------------------------------------------------------- /vendor/whistle/docs/new-docs/assets/trust-mac-rootca.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/new-docs/assets/trust-mac-rootca.jpg -------------------------------------------------------------------------------- /vendor/whistle/docs/new-docs/en/cli.md: -------------------------------------------------------------------------------- 1 | # 命令行操作 2 | 3 | ## w2 start 4 | 5 | ## w2 stop 6 | 7 | ## w2 restart 8 | 9 | ## w2 add 10 | 11 | ## 其它参数 12 | -------------------------------------------------------------------------------- /vendor/whistle/docs/new-docs/en/custom.md: -------------------------------------------------------------------------------- 1 | # 插件扩展 2 | 3 | ## 使用插件 4 | 5 | ## 开发插件 6 | -------------------------------------------------------------------------------- /vendor/whistle/docs/new-docs/en/examples/README.md: -------------------------------------------------------------------------------- 1 | # 一些应用 2 | -------------------------------------------------------------------------------- /vendor/whistle/docs/new-docs/en/faq.md: -------------------------------------------------------------------------------- 1 | # FAQ 2 | -------------------------------------------------------------------------------- /vendor/whistle/docs/new-docs/en/getting-started.md: -------------------------------------------------------------------------------- 1 | # 快速上手 2 | 安装启动好whistle,打开whistle的web界面:[http://local.whistlejs.com](http://local.whistlejs.com/) 3 | 4 | ![配置whistle规则界面]() 5 | 6 | 7 | 8 | whistle功能众多,基本上覆盖抓包调试工具方方面面的功能,但每个功能的操作方式都差不多,基本上都是通过类似设置系统hosts的方式,先回顾下传统hosts配置方式: 9 | ``` 10 | 127.0.0.1 www.test.com # 注释 11 | ``` 12 | 其中每一条规则占一行,并通过空格做分隔符,左边为IP,右边为域名,`#` 为注释。 13 | 14 | ``` 15 | pattern operation 16 | ``` 17 | 18 | 19 | ### 设置hosts 20 | 21 | ### 本地替换 22 | -------------------------------------------------------------------------------- /vendor/whistle/docs/new-docs/en/home.md: -------------------------------------------------------------------------------- 1 | test -------------------------------------------------------------------------------- /vendor/whistle/docs/new-docs/en/installation.md: -------------------------------------------------------------------------------- 1 | # 安装 2 | 3 | ## 安装Node 4 | 5 | ## 安装whistle 6 | 7 | ## 设置代理 8 | 9 | ## 安装根证书 10 | 11 | #### Windows 12 | 13 | #### Mac 14 | 15 | #### Android 16 | 17 | #### iOS 18 | 19 | #### Linux 20 | 21 | #### 可能遇到的问题 22 | 23 | 24 | ## 更新whistle 25 | -------------------------------------------------------------------------------- /vendor/whistle/docs/new-docs/en/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | -------------------------------------------------------------------------------- /vendor/whistle/docs/new-docs/en/protocols/README.md: -------------------------------------------------------------------------------- 1 | # 协议列表 2 | -------------------------------------------------------------------------------- /vendor/whistle/docs/new-docs/en/protocols/host.md: -------------------------------------------------------------------------------- 1 | # host -------------------------------------------------------------------------------- /vendor/whistle/docs/new-docs/en/protocols/rule/README.md: -------------------------------------------------------------------------------- 1 | ## rule -------------------------------------------------------------------------------- /vendor/whistle/docs/new-docs/en/protocols/rule/file.md: -------------------------------------------------------------------------------- 1 | ### file -------------------------------------------------------------------------------- /vendor/whistle/docs/new-docs/en/rule-introduction.md: -------------------------------------------------------------------------------- 1 | # 规则介绍 2 | 3 | ## pattern 4 | 5 | ## operation 6 | -------------------------------------------------------------------------------- /vendor/whistle/docs/new-docs/en/ui-operation.md: -------------------------------------------------------------------------------- 1 | # 界面操作 2 | 3 | ## Network 4 | 5 | ## Filter 6 | 7 | ## Frames 8 | 9 | ## Composer 10 | 11 | ## Rules 12 | 13 | ## 特殊字符 14 | 15 | ## Values 16 | 17 | ## Plugins 18 | 19 | ## Log 20 | 21 | ## weinre 22 | 23 | ## 快捷键 24 | -------------------------------------------------------------------------------- /vendor/whistle/docs/new-docs/zh/cli.md: -------------------------------------------------------------------------------- 1 | # 命令行操作 2 | 3 | ## w2 start 4 | 5 | ## w2 stop 6 | 7 | ## w2 restart 8 | 9 | ## w2 add 10 | 11 | ## 其它参数 12 | -------------------------------------------------------------------------------- /vendor/whistle/docs/new-docs/zh/custom.md: -------------------------------------------------------------------------------- 1 | # 插件扩展 2 | 3 | ## 使用插件 4 | 5 | ## 开发插件 6 | -------------------------------------------------------------------------------- /vendor/whistle/docs/new-docs/zh/examples/README.md: -------------------------------------------------------------------------------- 1 | # 一些应用 2 | -------------------------------------------------------------------------------- /vendor/whistle/docs/new-docs/zh/faq.md: -------------------------------------------------------------------------------- 1 | # 常见问题 2 | -------------------------------------------------------------------------------- /vendor/whistle/docs/new-docs/zh/getting-started.md: -------------------------------------------------------------------------------- 1 | # 快速上手 2 | 安装启动好whistle,打开whistle的web界面:[http://local.whistlejs.com](http://local.whistlejs.com/) 3 | 4 | ![配置whistle规则界面]() 5 | 6 | 7 | 8 | whistle功能众多,基本上覆盖抓包调试工具方方面面的功能,但每个功能的操作方式都差不多,基本上都是通过类似设置系统hosts的方式,先回顾下传统hosts配置方式: 9 | ``` 10 | 127.0.0.1 www.test.com # 注释 11 | ``` 12 | 其中每一条规则占一行,并通过空格做分隔符,左边为IP,右边为域名,`#` 为注释。 13 | 14 | ``` 15 | pattern operation 16 | ``` 17 | 18 | 19 | ### 设置hosts 20 | 21 | ### 本地替换 22 | -------------------------------------------------------------------------------- /vendor/whistle/docs/new-docs/zh/protocols/README.md: -------------------------------------------------------------------------------- 1 | # 协议列表 2 | -------------------------------------------------------------------------------- /vendor/whistle/docs/new-docs/zh/protocols/host.md: -------------------------------------------------------------------------------- 1 | # host -------------------------------------------------------------------------------- /vendor/whistle/docs/new-docs/zh/protocols/rule/README.md: -------------------------------------------------------------------------------- 1 | ## rule -------------------------------------------------------------------------------- /vendor/whistle/docs/new-docs/zh/protocols/rule/file.md: -------------------------------------------------------------------------------- 1 | ### file -------------------------------------------------------------------------------- /vendor/whistle/docs/new-docs/zh/rule-introduction.md: -------------------------------------------------------------------------------- 1 | # 规则介绍 2 | 3 | ## pattern 4 | 5 | ## operation 6 | -------------------------------------------------------------------------------- /vendor/whistle/docs/new-docs/zh/ui-operation.md: -------------------------------------------------------------------------------- 1 | # 界面操作 2 | 3 | ## Network 4 | 5 | ## Filter 6 | 7 | ## Frames 8 | 9 | ## Composer 10 | 11 | ## Rules 12 | 13 | ## 特殊字符 14 | 15 | ## Values 16 | 17 | ## Plugins 18 | 19 | ## Log 20 | 21 | ## weinre 22 | 23 | ## 快捷键 24 | -------------------------------------------------------------------------------- /vendor/whistle/docs/script/config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | langs: ['zh'] 3 | }; 4 | -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/attention.md: -------------------------------------------------------------------------------- 1 | # 注意事项 2 | 3 | 1. 没有[开启https拦截][1]的https、websocket的请求或者通过https代理过来的socket请求,由于无法获取代理内容的协议或者本身代理内容没有协议,方便配置时区分,whistle把这些请求的协议看成`tunnel:`,所以这里请求只能支持[域名匹配、正则匹配](pattern.html)和形如下面的路径匹配: 4 | 5 | tunnel://host operatorURI 6 | tunnel://host/ operatorURI 7 | tunnel://host:port operatorURI 8 | tunnel://host:port/ operatorURI 9 | 2. https代理也可以代理socket请求,前提对该请求不能[开启https拦截][1],可以在代理头部新增`x-whistle-policy: tunnel`,这时whistle对该HTTPS代理的请求不会[开启https拦截][1],即使whistle本身[开启https拦截][1]。 10 | 3. 还有一些遇到过的问题可以查看:[常见问题](questions.html) 11 | 4. 用户反馈见:[用户反馈](fallback.html) 12 | 13 | [1]: webui/https.html "https拦截" 14 | -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/cases.md: -------------------------------------------------------------------------------- 1 | # 常见应用 2 | 3 | * [利用 whistle 调试移动端页面](http://imweb.io/topic/5981a34bf8b6c96352a59401) 4 | * [利用 whistle 调试 WebSocket 和 Socket 请求](http://imweb.io/topic/5a11b1b8ef79bc941c30d91a) 5 | -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/feedback.md: -------------------------------------------------------------------------------- 1 | # 用户反馈 2 | 3 | 1. 有问题请直接提issue: [New issue](https://github.com/avwo/whistle/issues/new) 4 | 2. 欢迎提PR: [Pull requests](https://github.com/avwo/whistle/compare) 5 | 3. 有什么问题也可以通过QQ群反馈: 462558941 -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/gitbook/images/apple-touch-icon-precomposed-152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/gitbook/images/apple-touch-icon-precomposed-152.png -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/gitbook/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/gitbook/images/favicon.ico -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/Android_proxy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/Android_proxy.png -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/composer.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/composer.gif -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/firefox-proxy-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/firefox-proxy-1.jpg -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/firefox-proxy-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/firefox-proxy-2.jpg -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/host01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/host01.png -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/host02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/host02.png -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/http-request.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/http-request.png -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/https.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/https.gif -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/iOS-proxy-all.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/iOS-proxy-all.jpg -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/iOS-proxy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/iOS-proxy.jpg -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/iOS_proxy.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/iOS_proxy.PNG -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/iOS_proxy_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/iOS_proxy_settings.png -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/ios10.3_ca.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/ios10.3_ca.PNG -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/linux-proxy-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/linux-proxy-1.jpg -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/linux-proxy-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/linux-proxy-2.jpg -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/log-basic.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/log-basic.gif -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/log-switch.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/log-switch.gif -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/mac-proxy-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/mac-proxy-1.jpg -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/mac-proxy-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/mac-proxy-2.jpg -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/network.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/network.gif -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/online.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/online.gif -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/plugin-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/plugin-list.png -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/plugin1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/plugin1.png -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/plugin2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/plugin2.png -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/plugin3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/plugin3.png -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/plugins.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/plugins.gif -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/rules.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/rules.gif -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/seq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/seq.png -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/settings.png -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/start_w2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/start_w2.jpg -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/switchyomega.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/switchyomega.jpg -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/tunnel-request.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/tunnel-request.png -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/values.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/values.gif -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/weinre.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/weinre.gif -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/img/windows_rootca.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/docs/zh/img/windows_rootca.jpeg -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/rules/accept.md: -------------------------------------------------------------------------------- 1 | # accept 2 | 为尽可能缩减协议,减少复杂度,该协议已在最新版本的 whistle (`>=v1.12.3`) 中删除,请及时[更新whistle](../update.html),并用[reqHeaders](./reqHeaders.html)代替: 3 | ``` 4 | pattern reqHeaders://accept=acceptType 5 | ``` 6 | 7 | -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/rules/hostname.md: -------------------------------------------------------------------------------- 1 | # hostname 2 | 为尽可能缩减协议,减少复杂度,该协议已在最新版本的 whistle (`>=v1.12.3`) 中删除,请及时[更新whistle](../update.html),并用[reqHeaders](./reqHeaders.html)代替: 3 | ``` 4 | pattern reqHeaders://host=www.qq.com 5 | ``` 6 | 7 | -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/rules/http-proxy.md: -------------------------------------------------------------------------------- 1 | 同 [proxy](./proxy.html)。 2 | -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/rules/params.md: -------------------------------------------------------------------------------- 1 | # params 2 | > 同[reqMerge](reqMerge.html) 3 | -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/rules/rule/README.md: -------------------------------------------------------------------------------- 1 | # 响应规则列表 2 | 3 | 1. [**请求替换**](replace.html) 4 | 1. [**file** (替换本地文件)](file.html) 5 | 1. [**xfile** (替换本地文件,如果本地文件不存在,则请求线上)](file.html) 6 | 1. [**rawfile** (替换本地http响应内容格式的文件)](rawfile.html) 7 | 1. [**xrawfile** (替换本地http响应内容格式的文件,如果本地文件不存在,则请求线上)](rawfile.html) 8 | 1. [**tpl** (替换本地目标文件,可用于模拟jsonp请求)](tpl.html) 9 | 1. [**xtpl** (同上,与xfile类似)](tpl.html) 10 | 1. [**statusCode** (设置响应状态码)](statusCode.html) 11 | 1. [**自定义**](custom.html) 12 | -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/rules/rule/custom.md: -------------------------------------------------------------------------------- 1 | # 自定义规则 2 | 3 | whistle提供了插件的方式扩展协议,具体参考:[插件开发](../../plugins.html) -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/rules/rule/xrawfile.md: -------------------------------------------------------------------------------- 1 | # xrawfile 2 | 3 | __xrawfile功能同rawfile一样,和rawfile的唯一区别是rawfile找不到对应文件返回404,而xrawfile则是继续请求线上资源。__ 4 | 5 | 用法参考 [rawfile](rawfile.html) 6 | -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/rules/rule/xtpl.md: -------------------------------------------------------------------------------- 1 | # xtpl 2 | 3 | __xtpl功能同tpl一样,和tpl的唯一区别是tpl找不到对应文件返回404,而xtpl则是继续请求线上资源。__ 4 | 5 | 6 | 用法参考 [tpl](tpl.html) 7 | -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/rules/statusCode.md: -------------------------------------------------------------------------------- 1 | [点击查看新文档](rule/statusCode.html) 2 | -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/webui/README.md: -------------------------------------------------------------------------------- 1 | # 界面列表 2 | 3 | 1. [Network(请求列表页面)](network.md) 4 | 1. [Composer(构造请求)](composer.md) 5 | 1. [Log(日志平台)](log.md) 6 | 1. [Rules(操作规则配置界面)](rules.md) 7 | 1. [Values(存放KeyValue的系统)](values.md) 8 | 1. [Plugins(插件列表页面)](plugins.md) 9 | 1. [WebSocket(WebSocket抓包功能)](websocket.md) 10 | 1. [Filter(设置Network请求列表的过滤条件)](filter.md) 11 | 1. [Settings(设置对话框)](settings.md) 12 | 1. [Files(上传大块内容文件)](files.md) 13 | 1. [Weinre(weinre列表)](weinre.md) 14 | 1. [HTTPS(设置HTTPS拦截及根证书)](https.md) 15 | 1. [Help(帮助文档)](help.md) 16 | 1. [About(whistle版本信息)](about.md) 17 | 1. [Online(在线状态及服务器信息)](online.md) 18 | -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/webui/composer.md: -------------------------------------------------------------------------------- 1 | # Componser 2 | 3 | 用来重发请求、构造请求,可以自定义请求的url、请求方法、请求头、请求内容。 4 | 5 | ![Componser](../img/composer.gif) -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/webui/files.md: -------------------------------------------------------------------------------- 1 | # Files 2 | Files 作为 [Values](values.html) 功能的补充,可以存放最大20m的文本或二进制内容(Values只能存放比较小的文本内容),主要用于快速将请求或响应内容保存到系统文件,方便做本地替换,也可以在whistle远程部署时,上传大块文件用来设置规则(本地部署可以直接配置本地路径即可)。 3 | 4 | ![快速替换某请求的响应内容](https://user-images.githubusercontent.com/11450939/55725953-4d6eec80-5a41-11e9-9520-4f7e300a5cec.gif) 5 | -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/webui/log.md: -------------------------------------------------------------------------------- 1 | # Log 2 | 3 | > 主要用于调试远程页面特别是移动端页面,可以通过此功能把远程页面 `console` 打印的信息展示出来,使用方法参见 [log](../rules/log.html)。 4 | 5 | ![Log](../img/log-basic.gif) 6 | 7 | 其中: 8 | 9 | 1. `Console` 显示页面抛出的异常或通过 `console` 打印的信息 10 | 2. `Server` 显示 whistle 内部发生的异常信息 11 | 3. `All Logs` 用于切换不同页面的 log 显示,这个功能详见 [log 高级使用](../rules/log.html) -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/webui/network.md: -------------------------------------------------------------------------------- 1 | # Network 2 | 3 | 查看请求响应的详细信息及请求列表的Timeline,还有请求匹配到的规则(见`Overview`)。 4 | 5 | ![Network](../img/network.gif) 6 | 7 | 界面操作的一些快捷键: 8 | 9 | 1. `Ctrl + X`(Mac用`Command + X`): 清空请求列 10 | 2. `Ctrl + D`(Mac用`Command + D`): 11 | - 如果是焦点在下面的过滤输入框,可以清空输入框的内容 12 | - 如果焦点在Network的其它地方,可以删除选中的请求项 13 | 14 | 更多功能及快捷键参考下图: 15 | 16 | ![Network](https://raw.githubusercontent.com/avwo/whistleui/master/img/network.png) 17 | -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/webui/online.md: -------------------------------------------------------------------------------- 1 | # Online 2 | 当前whistle是否在线及查看whistle服务的基本信息,包括: 3 | 4 | - 运行的Node版本 5 | - whistle的端口号及IP,方便移动端配置代理 6 | 7 | ![Online](../img/online.gif) -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/webui/plugins.md: -------------------------------------------------------------------------------- 1 | # Plugins 2 | > 如何开发插件参考:[插件开发](../plugins.html) 3 | 4 | 显示所有已安装的插件列表,开启关闭插件功能,打开插件的管理页面等。 5 | 6 | ![Plugins](../img/plugins.gif) -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/webui/values.md: -------------------------------------------------------------------------------- 1 | # Values 2 | 配置`key-value`的数据,在Rules里面配置可以通过`{key}`获取,如:`www.ifeng.com file://{key}` 3 | 4 | ![Values](../img/values.gif) 5 | 6 | 界面操作的一些快捷键: 7 | 8 | 1. `Ctrl + D`(Mac用`Command + D`): 9 | - 如果焦点在左侧的列表,可以删除列表项 10 | - 如果焦点在右侧的编辑框,可以删除光标所在行 11 | 2. `Ctrl + /`(Mac用`Command + /`): 注释编辑框中选中的行 12 | 3. `Ctrl + S`(Mac用`Command + S`): 保存当前编辑的内容 -------------------------------------------------------------------------------- /vendor/whistle/docs/zh/webui/weinre.md: -------------------------------------------------------------------------------- 1 | # Weinre 2 | 集成[weinre](http://people.apache.org/~pmuellr/weinre/docs/latest/)的功能,用户只需通过简单配置(`pattern weinre://id`)即可使用,具体参见[weinre](../rules/weinre.html),更多移动端调试方法可以参考:[利用whistle调试移动端页面](http://imweb.io/topic/5981a34bf8b6c96352a59401)。 3 | 4 | ![Weinre](../img/weinre.gif) -------------------------------------------------------------------------------- /vendor/whistle/lib/handlers/error-handler.js: -------------------------------------------------------------------------------- 1 | var util = require('../util'); 2 | 3 | module.exports = function(err, req, res, next) { 4 | res.response(util.wrapGatewayError(util.getErrorStack(err))); 5 | }; 6 | -------------------------------------------------------------------------------- /vendor/whistle/lib/handlers/final-handler.js: -------------------------------------------------------------------------------- 1 | module.exports = function(req, res, next) { 2 | next(new Error('Unknown protocol ' + req.options.protocol)); 3 | }; 4 | 5 | 6 | -------------------------------------------------------------------------------- /vendor/whistle/lib/handlers/http-proxy.js: -------------------------------------------------------------------------------- 1 | module.exports = function(req, res, next) { 2 | if (!req.isWebProtocol) { 3 | next(); 4 | return; 5 | } 6 | req.request(req.options); 7 | }; 8 | -------------------------------------------------------------------------------- /vendor/whistle/lib/handlers/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = [ 3 | './file-proxy', 4 | './plugin-handler', 5 | './http-proxy', 6 | './final-handler', 7 | './error-handler'].map(function(mod) { 8 | return require(mod); 9 | }); 10 | -------------------------------------------------------------------------------- /vendor/whistle/lib/inspectors/index.js: -------------------------------------------------------------------------------- 1 | module.exports = [ 2 | './rules', 3 | './weinre', 4 | './log', 5 | './req', 6 | './data', 7 | './res' 8 | ] 9 | .map(function(mod) { 10 | return require(mod); 11 | }); 12 | -------------------------------------------------------------------------------- /vendor/whistle/lib/service/index.js: -------------------------------------------------------------------------------- 1 | var fork = require('pfork').fork; 2 | var path = require('path'); 3 | var config = require('../config'); 4 | 5 | function loadService(callback) { 6 | fork({ 7 | script: path.join(__dirname, 'service.js'), 8 | debugMode: config.debugMode 9 | }, callback); 10 | } 11 | 12 | module.exports = loadService; 13 | -------------------------------------------------------------------------------- /vendor/whistle/lib/util/buf-util.js: -------------------------------------------------------------------------------- 1 | exports.indexOf = function(buf, subBuf, start) { 2 | start = start || 0; 3 | if (buf.indexOf) { 4 | return buf.indexOf(subBuf, start); 5 | } 6 | 7 | var subLen = subBuf.length; 8 | if (subLen) { 9 | for (var i = start, len = buf.length - subLen; i <= len; i++) { 10 | var j = 0; 11 | for (; j < subLen; j++) { 12 | if (subBuf[j] !== buf[i + j]) { 13 | break; 14 | } 15 | } 16 | if (j == subLen) { 17 | return i; 18 | } 19 | } 20 | } 21 | 22 | return -1; 23 | }; 24 | -------------------------------------------------------------------------------- /vendor/whistle/lib/util/drain.js: -------------------------------------------------------------------------------- 1 | var PassThrough = require('stream').PassThrough; 2 | 3 | var noop = function() {}; 4 | 5 | module.exports = function(stream, endHandler) { 6 | if (stream._hasAlreadyDrain) { 7 | return typeof endHandler == 'function' && endHandler(); 8 | } 9 | stream._hasAlreadyDrain = true; 10 | var emitEndStream = new PassThrough(); 11 | emitEndStream.on('data', noop).on('error', noop); 12 | emitEndStream.on('end', endHandler); 13 | stream.pipe(emitEndStream); 14 | }; -------------------------------------------------------------------------------- /vendor/whistle/test/assets/files/1.txt: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /vendor/whistle/test/assets/files/2.txt: -------------------------------------------------------------------------------- 1 | 2 -------------------------------------------------------------------------------- /vendor/whistle/test/assets/files/3.txt: -------------------------------------------------------------------------------- 1 | 3 -------------------------------------------------------------------------------- /vendor/whistle/test/assets/files/empty.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/test/assets/files/empty.txt -------------------------------------------------------------------------------- /vendor/whistle/test/assets/files/gb2312.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/test/assets/files/gb2312.txt -------------------------------------------------------------------------------- /vendor/whistle/test/assets/files/rules.txt: -------------------------------------------------------------------------------- 1 | str.w2.org/index.html file://`(${search.replace(a,b)})` 2 | str.w2.org/index2.html file://`(${query.replace(/a/g,b)})` -------------------------------------------------------------------------------- /vendor/whistle/test/assets/files/storage/.backup/1.test1.tx: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /vendor/whistle/test/assets/files/storage/.backup/2.test2.tx: -------------------------------------------------------------------------------- 1 | 2 -------------------------------------------------------------------------------- /vendor/whistle/test/assets/files/storage/.backup/3.test3.tx: -------------------------------------------------------------------------------- 1 | 3 -------------------------------------------------------------------------------- /vendor/whistle/test/assets/files/storage/.backup/properties: -------------------------------------------------------------------------------- 1 | {"filesOrder":["test1.tx","test2.tx","test3.tx"]} 2 | -------------------------------------------------------------------------------- /vendor/whistle/test/assets/files/storage/files/1.test1.tx: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /vendor/whistle/test/assets/files/storage/files/2.test2.tx: -------------------------------------------------------------------------------- 1 | 2 -------------------------------------------------------------------------------- /vendor/whistle/test/assets/files/storage/files/3.test3.tx: -------------------------------------------------------------------------------- 1 | 3 -------------------------------------------------------------------------------- /vendor/whistle/test/assets/files/storage/properties: -------------------------------------------------------------------------------- 1 | {"filesOrder":["test1.tx","test2.tx","test3.tx"]} 2 | -------------------------------------------------------------------------------- /vendor/whistle/test/assets/files/test.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/whistle/test/assets/files/test.txt -------------------------------------------------------------------------------- /vendor/whistle/test/assets/values/rawFile.html: -------------------------------------------------------------------------------- 1 | HTTP/1.1 500 OK 2 | content-type: text/plain 3 | 4 | test2 -------------------------------------------------------------------------------- /vendor/whistle/test/assets/values/rawFile2.js: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | content-type: application/javascript 3 | set-cookie: res_cookie_name=123; domain=.test.com; samesite=Lax; path=/; max-age=20000; expires=sxxxx; secure; httponly 4 | 5 | -------------------------------------------------------------------------------- /vendor/whistle/test/assets/values/reqScript.js: -------------------------------------------------------------------------------- 1 | rules.push(headers.host + ' file://{test.html}'); 2 | reqScriptData.test = body || 123; 3 | values['test.html'] = render('<%=test%>', {test: body || 123}); 4 | -------------------------------------------------------------------------------- /vendor/whistle/test/assets/values/resScript.js: -------------------------------------------------------------------------------- 1 | values.test = {'x-test': render('<%=test%>', {test: reqScriptData.test})}; 2 | rules.push(headers.host + ' resHeaders://{test}'); 3 | -------------------------------------------------------------------------------- /vendor/whistle/test/assets/values/rulesFile.js: -------------------------------------------------------------------------------- 1 | if (isLocalAddress()) { 2 | rules.push('rf1.w2.org file://{test.json}'); 3 | } 4 | -------------------------------------------------------------------------------- /vendor/whistle/test/assets/values/rulesFile.txt: -------------------------------------------------------------------------------- 1 | # rules 2 | rf2.w2.org file://{test2.json} -------------------------------------------------------------------------------- /vendor/whistle/test/assets/values/rulesFile2.js: -------------------------------------------------------------------------------- 1 | rules = null; -------------------------------------------------------------------------------- /vendor/whistle/test/assets/values/test.json: -------------------------------------------------------------------------------- 1 | { 2 | "test": "values" 3 | } -------------------------------------------------------------------------------- /vendor/whistle/test/assets/values/test2.json: -------------------------------------------------------------------------------- 1 | { 2 | "test": "values2" 3 | } -------------------------------------------------------------------------------- /vendor/whistle/test/assets/values/test3.json: -------------------------------------------------------------------------------- 1 | { 2 | "test": "values3" 3 | } -------------------------------------------------------------------------------- /vendor/whistle/test/assets/values/tps.rules: -------------------------------------------------------------------------------- 1 | # rules 2 | 2.tps.whistlejs.com jsAppend://`{${reqCookie.name}}` -------------------------------------------------------------------------------- /vendor/whistle/test/assets/values/tps1.json: -------------------------------------------------------------------------------- 1 | { 2 | "url": "${url}", 3 | "search": "${url.search}", 4 | "query": "${url.query}", 5 | "queryValue": "${url.query.name}", 6 | "host": "${url.host}", 7 | "hostname": "${url.hostname}", 8 | "path": "${url.path}", 9 | "pathname": "${url.pathname}", 10 | "reqId": "${reqId}", 11 | "now": ${now}, 12 | "method": "${method}", 13 | "xff": "${reqHeaders.x-test}", 14 | "other": "${reqHeaders.other}", 15 | "cookie": "${reqCookie}", 16 | "cookieValue": "${reqCookie.cookieName}", 17 | "clientIp": "${clientIp}" 18 | } -------------------------------------------------------------------------------- /vendor/whistle/test/config.test.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = { 3 | port: 6666, 4 | serverPort: 8080, 5 | wsPort: 8081, 6 | httpsPort: 5566, 7 | socksPort: 1080, 8 | authSocksPort: 1118, 9 | proxyPort: 7788, 10 | httpServerPort: 2080, 11 | httpsServerPort: 2081 12 | }; 13 | -------------------------------------------------------------------------------- /vendor/whistle/test/events.js: -------------------------------------------------------------------------------- 1 | var EventEmitter = require('events'); 2 | 3 | module.exports = new EventEmitter(); -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/@test/whistle.test3/index.js: -------------------------------------------------------------------------------- 1 | exports.reqRulesServer = function(server) { 2 | server.on('request', function(req, res) { 3 | res.end('tp.w2.org/index.html resType://html rulesFile://{rulesFile.js}\nths.w2.org file://{test.json}'); 4 | }); 5 | }; 6 | 7 | exports.tunnelRulesServer = function(server) { 8 | server.on('request', function(req, res) { 9 | res.end('ths.w2.org filter://https'); 10 | }); 11 | }; -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/@test/whistle.test3/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@test/whistle.test3", 3 | "version": "0.0.0", 4 | "description": "test3", 5 | "license": "MIT" 6 | } 7 | -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/@test/whistle.test3/test/abc/abc/index.html: -------------------------------------------------------------------------------- 1 | { 2 | "name": "https" 3 | } 4 | -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/@test/whistle.test3/test/abc/index.html: -------------------------------------------------------------------------------- 1 | { 2 | "name": "http" 3 | } 4 | -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/whistle.pipe-http/index.js: -------------------------------------------------------------------------------- 1 | 2 | exports.reqReadServer = require('./lib/reqReadServer'); 3 | exports.reqWriteServer = require('./lib/reqWriteServer'); 4 | exports.resReadServer = require('./lib/resReadServer'); 5 | exports.resWriteServer = require('./lib/resWriteServer'); 6 | -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/whistle.pipe-http/lib/reqReadServer.js: -------------------------------------------------------------------------------- 1 | module.exports = function(server) { 2 | server.on('request', function(req, res) { 3 | req.pipe(res); 4 | }); 5 | }; 6 | -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/whistle.pipe-http/lib/reqWriteServer.js: -------------------------------------------------------------------------------- 1 | module.exports = function(server) { 2 | server.on('request', function(req, res) { 3 | req.pipe(res); 4 | }); 5 | }; 6 | -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/whistle.pipe-http/lib/resReadServer.js: -------------------------------------------------------------------------------- 1 | module.exports = function(server) { 2 | server.on('request', function(req, res) { 3 | req.pipe(res); 4 | }); 5 | }; 6 | -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/whistle.pipe-http/lib/resWriteServer.js: -------------------------------------------------------------------------------- 1 | module.exports = function(server) { 2 | server.on('request', function(req, res) { 3 | req.pipe(res); 4 | }); 5 | }; 6 | -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/whistle.pipe-http/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "whistle.pipe-http", 3 | "version": "1.0.0", 4 | "whistleConfig": { 5 | "hintList": [ 6 | { 7 | "value": "123456", 8 | "label": "ssssssss", 9 | "help": "http://www.qq.com" 10 | }, 11 | "sdfasfasfd" 12 | ], 13 | "hideShortProtocol": true, 14 | "hideLongProtocol": true, 15 | "hintUrl": "/", 16 | "rulesUrl": "/", 17 | "valuesUrl": "/" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/whistle.pipe-http/rules.txt: -------------------------------------------------------------------------------- 1 | http://* pipe://pipe-http -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/whistle.pipe-tunnel/index.js: -------------------------------------------------------------------------------- 1 | 2 | exports.tunnelReqRead = require('./lib/tunnelReqRead'); 3 | exports.tunnelReqWrite = require('./lib/tunnelReqWrite'); 4 | exports.tunnelResRead = require('./lib/tunnelResRead'); 5 | exports.tunnelResWrite = require('./lib/tunnelResWrite'); 6 | -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/whistle.pipe-tunnel/lib/tunnelReqRead.js: -------------------------------------------------------------------------------- 1 | module.exports = function(server) { 2 | server.on('connect', function(_, socket) { 3 | socket.pipe(socket); 4 | }); 5 | }; 6 | -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/whistle.pipe-tunnel/lib/tunnelReqWrite.js: -------------------------------------------------------------------------------- 1 | module.exports = function(server) { 2 | server.on('connect', function(_, socket) { 3 | socket.pipe(socket); 4 | }); 5 | }; 6 | -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/whistle.pipe-tunnel/lib/tunnelResRead.js: -------------------------------------------------------------------------------- 1 | module.exports = function(server) { 2 | server.on('connect', function(_, socket) { 3 | socket.pipe(socket); 4 | }); 5 | }; 6 | -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/whistle.pipe-tunnel/lib/tunnelResWrite.js: -------------------------------------------------------------------------------- 1 | module.exports = function(server) { 2 | server.on('connect', function(_, socket) { 3 | socket.pipe(socket); 4 | }); 5 | }; 6 | -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/whistle.pipe-tunnel/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "whistle.pipe-tunnel", 3 | "version": "1.1.1" 4 | } 5 | -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/whistle.pipe-tunnel/rules.txt: -------------------------------------------------------------------------------- 1 | tunnel://* pipe://pipe-tunnel -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/whistle.pipe-ws/index.js: -------------------------------------------------------------------------------- 1 | 2 | exports.wsReqRead = require('./lib/wsReqRead'); 3 | exports.wsReqWrite = require('./lib/wsReqWrite'); 4 | exports.wsResRead = require('./lib/wsResRead'); 5 | exports.wsResWrite = require('./lib/wsResWrite'); 6 | -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/whistle.pipe-ws/lib/wsReqRead.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = function(server) { 3 | server.on('connect', function(_, socket) { 4 | socket.pipe(socket); 5 | }); 6 | }; 7 | -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/whistle.pipe-ws/lib/wsReqWrite.js: -------------------------------------------------------------------------------- 1 | module.exports = function(server) { 2 | server.on('connect', function(_, socket) { 3 | socket.pipe(socket); 4 | }); 5 | }; 6 | -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/whistle.pipe-ws/lib/wsResRead.js: -------------------------------------------------------------------------------- 1 | module.exports = function(server) { 2 | server.on('connect', function(_, socket) { 3 | socket.pipe(socket); 4 | }); 5 | }; 6 | -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/whistle.pipe-ws/lib/wsResWrite.js: -------------------------------------------------------------------------------- 1 | module.exports = function(server) { 2 | server.on('connect', function(_, socket) { 3 | socket.pipe(socket); 4 | }); 5 | }; 6 | -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/whistle.pipe-ws/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "whistle.pipe-ws", 3 | "version": "1.1.1" 4 | } 5 | -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/whistle.pipe-ws/rules.txt: -------------------------------------------------------------------------------- 1 | ws://* pipe://pipe-ws -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/whistle.test1/_rules.txt: -------------------------------------------------------------------------------- 1 | delete.test.whistlejs.com delete://req.headers.x-delete-req|res.headers.x-delete-res|headers.x-delete-all -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/whistle.test1/index.js: -------------------------------------------------------------------------------- 1 | exports.rulesServer = require('./lib/rulesServer'); 2 | -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/whistle.test1/lib/rulesServer.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = function(server, options) { 3 | server.on('request', function(req, res) { 4 | if (req.headers.host === 'var1.wproxy.org') { 5 | return res.end(JSON.stringify({ 6 | rules: '/./ file://(${json0}${json1},${json2},${json3}${jsonN})', 7 | values: { 8 | json0: '{', 9 | json1: '"json1": 1', 10 | json2: '"json2": 2', 11 | json3: '"json3": 3', 12 | jsonN: '}' 13 | } 14 | })); 15 | } 16 | res.end('mp1.w2.org/index.html resType://html\nhttps2.w2.org filter://https'); 17 | }); 18 | }; -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/whistle.test1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "whistle.test1", 3 | "version": "0.0.0", 4 | "description": "test1", 5 | "license": "MIT" 6 | } 7 | -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/whistle.test1/rules.txt: -------------------------------------------------------------------------------- 1 | /./ whistle.test1://test1 -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/whistle.test2/_rules.txt: -------------------------------------------------------------------------------- 1 | mp1.w2.org/index.html resCharset://gbk 2 | enable3.w2.org test://abc 3 | enable4.w2.org test://123 4 | 5 | range2.whistlejs.com file://test.txt 6 | -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/whistle.test2/index.js: -------------------------------------------------------------------------------- 1 | exports.statsServer = function(server, options) { 2 | server.on('request', function(req, res) { 3 | res.end(); 4 | }); 5 | }; -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/whistle.test2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "whistle.test2", 3 | "version": "0.0.0", 4 | "description": "test2", 5 | "license": "MIT" 6 | } 7 | -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/whistle.test2/rules.txt: -------------------------------------------------------------------------------- 1 | /./ whistle.test2://test2 2 | enable1.w2.org enable://intercept test://test proxy://test:123@127.0.0.1:7788 3 | enable2.w2.org enable://intercept test://test proxy://test:123@127.0.0.1:7788 4 | enable2.w2.org ignore://test 5 | 6 | enable3.w2.org enable://intercept proxy://test:123@127.0.0.1:7788 whistle.test2:// 7 | enable4.w2.org enable://intercept proxy://test:123@127.0.0.1:7788 whistle.test2:// 8 | 9 | enable4.w2.org ignore://whistle.test2 10 | 11 | var1.wproxy.org/index.html whistle.test1:// -------------------------------------------------------------------------------- /vendor/whistle/test/plugins/whistle.test2/test.txt: -------------------------------------------------------------------------------- 1 | 0123456789 -------------------------------------------------------------------------------- /vendor/whistle/test/units/attachment.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('http://attachment.test.whistlejs.com/index.html', function(res, data) { 5 | res.headers.should.have.property('content-disposition', 'attachment; filename="index.html"'); 6 | }); 7 | 8 | util.request({ 9 | method: 'put', 10 | url: 'https://attachment.test.whistlejs.com/index2.html' 11 | }, function(res, data) { 12 | res.headers.should.have.property('content-disposition', 'attachment; filename="index2.html"'); 13 | }); 14 | }; 15 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/auth.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('http://au2th.test.whistlejs.com/index.html', function(res, data) { 5 | data.headers.should.not.have.property('authorization'); 6 | }); 7 | 8 | util.request({ 9 | method: 'put', 10 | url: 'https://auth.test.whistlejs.com/index2.html' 11 | }, function(res, data) { 12 | data.headers.should.have.property('authorization'); 13 | }); 14 | }; 15 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/cache.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('http://cache.test.whistlejs.com/index.html', function(res, data) { 5 | res.headers.should.have.property('cache-control', 'max-age=60000'); 6 | }); 7 | 8 | util.request({ 9 | method: 'post', 10 | url: 'https://cache.test.whistlejs.com/index.html' 11 | }, function(res, data) { 12 | res.headers.should.have.property('cache-control', 'max-age=60000'); 13 | }); 14 | }; 15 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/common.test.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var fs = require('fs'); 3 | var isUtf8 = require('../../lib/util/is-utf8'); 4 | var createStorage = require('../../lib/rules/storage'); 5 | 6 | var BASE_DIR = path.join(__dirname, '../assets/files/'); 7 | 8 | module.exports = function() { 9 | var gb2312Buf = fs.readFileSync(path.join(BASE_DIR, 'gb2312.txt')); 10 | var utf8Buf = fs.readFileSync(path.join(BASE_DIR, '1.txt')); 11 | isUtf8(gb2312Buf).should.equal(false); 12 | isUtf8(utf8Buf).should.equal(true); 13 | createStorage(path.join(BASE_DIR, 'storage')); 14 | }; -------------------------------------------------------------------------------- /vendor/whistle/test/units/connect.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('ws://connect.whistlejs.com/index.html', function(data) { 5 | data.type.should.equal('server'); 6 | }); 7 | 8 | util.request('ws://connect.whistlejs.com/index.html', function(data) { 9 | data.type.should.equal('server'); 10 | }); 11 | }; 12 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/css.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('http://css1.test.whistlejs.com/index.html?resBody=_', function(res, body) { 5 | body.should.equal('_\r\n'); 6 | }); 7 | 8 | util.request({ 9 | method: 'post', 10 | url: 'https://css2.test.whistlejs.com/index.html?resBody=_' 11 | }, function(res, body) { 12 | body.should.equal('_\r\ncss'); 13 | }); 14 | 15 | util.request({ 16 | method: 'post', 17 | url: 'https://css3.test.whistlejs.com/index.html?resBody=_' 18 | }, function(res, body) { 19 | body.should.equal('_'); 20 | }); 21 | }; 22 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/disable.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('http://disable.test.whistlejs.com/index.html', function(res, data) { 5 | res.headers.should.have.property('cache-control', 'no-cache'); 6 | }); 7 | 8 | util.request({ 9 | method: 'post', 10 | url: 'https://disable.test.whistlejs.com/index.html' 11 | }, function(res, data) { 12 | res.headers.should.have.property('cache-control', 'no-cache'); 13 | res.headers.should.not.have.property('set-cookie'); 14 | }); 15 | }; 16 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/file.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('http://file.test.whistlejs.com/index.html', function(res, data) { 5 | data.should.have.property('body', 'html'); 6 | }); 7 | 8 | util.request({ 9 | url: 'https://file.test.whistlejs.com/index.html', 10 | method: 'post', 11 | body: util.getTextBySize(3072) 12 | }, function(res, data) { 13 | data.should.have.property('body', 'html'); 14 | }); 15 | }; 16 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/forward.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('http://forward.test.whistlejs.com/index.html', function(res, data) { 5 | data.should.have.property('type', 'server'); 6 | }); 7 | 8 | util.request({ 9 | method: 'post', 10 | url: 'http://forward.test.whistlejs.com/index.html' 11 | }, function(res, data) { 12 | data.should.have.property('type', 'server'); 13 | }); 14 | }; 15 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/host.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('http://host.test.whistlejs.com/index.html', function(res, data) { 5 | data.should.have.property('type', 'server'); 6 | }); 7 | util.request('http://127.0.0.1:8080/xhost.html', function(res, data) { 8 | data.should.have.property('type', 'server'); 9 | }); 10 | }; 11 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/ignore.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('https://enable1.w2.org', function(res, data) { 5 | data.url.should.be.equal('https://enable1.w2.org/'); 6 | }); 7 | util.request('https://enable2.w2.org:5566', function(res, data) { 8 | data.body.should.be.equal('test'); 9 | }); 10 | util.request('https://enable3.w2.org:5566', function(res, data) { 11 | data.url.should.be.equal('https://enable3.w2.org:5566/'); 12 | }); 13 | util.request('https://enable4.w2.org:5566', function(res, data) { 14 | data.body.should.be.equal('test'); 15 | }); 16 | }; 17 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/method.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('http://test.whistlejs.com/index.html', function(res, data) { 5 | data.method.should.equal('GET'); 6 | }); 7 | 8 | util.request({ 9 | method: 'put', 10 | url: 'https://test.whistlejs.com/index.html' 11 | }, function(res, data) { 12 | data.method.should.equal('PUT'); 13 | }); 14 | }; 15 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/options.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('http://test.options.com/index.html', function(res, data) { 5 | data.method.should.equal('options'); 6 | }); 7 | }; 8 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/others.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('http://unknownprotocol.w2.org/index.html?doNotParseJson', function(res, data) { 5 | res.statusCode.should.be.equal(502); 6 | }); 7 | require('../../biz/webui/cgi-bin/util').formatDate(); 8 | util.request('http://test.internal.path.com/...whistle-path.5b6af7b9884e1165...///whistle._abc/index.html', function(res, data) { 9 | data.url.should.be.equal('/...whistle-path.5b6af7b9884e1165...///whistle._abc/index.html'); 10 | }); 11 | }; 12 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/pac.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('http://pac.test.com/index.html', function(res, data) { 5 | data.should.be.have.property('type', 'server'); 6 | }); 7 | util.request({ 8 | url: 'http://pac.test.com/index.html', 9 | method: 'post' 10 | }, function(res, data) { 11 | data.should.be.have.property('type', 'server'); 12 | }); 13 | }; 14 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/plugins.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('http://mp1.w2.org/index.html', function(res, data) { 5 | res.headers['content-type'].should.be.equal('text/html; charset=gbk'); 6 | data.headers['x-whistle-rule-value'].should.be.equal('123'); 7 | }); 8 | 9 | util.request('https://ths.w2.org/index.html', function(res, data) { 10 | data.test.should.be.equal('values'); 11 | }); 12 | }; 13 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/range.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request({ 5 | uri: 'http://range1.whistlejs.com/index.html', 6 | headers: { 7 | 'range': 'bytes=2-3,5-6' 8 | } 9 | }, function(res, body) { 10 | body.should.equal(23456); 11 | }); 12 | util.request({ 13 | url: 'http://range2.whistlejs.com/', 14 | headers: { 15 | 'range': 'bytes=2-3,1-8' 16 | } 17 | }, function(res, body) { 18 | body.should.equal(12345678); 19 | }); 20 | }; 21 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/redirect.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('https://redirect.test.whistlejs.com/index.html', function(res, data) { 5 | data.should.have.property('url', 'http://test.whistlejs.com/'); 6 | }); 7 | 8 | util.request({ 9 | method: 'post', 10 | url: 'http://redirect.test.whistlejs.com/index.html' 11 | }, function(res, data) { 12 | data.should.have.property('url', 'http://test.whistlejs.com/'); 13 | }); 14 | }; 15 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/referer.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('http://referer.test.whistlejs.com/index.html', function(res, data) { 5 | data.headers.should.have.property('referer', 'xxx'); 6 | }); 7 | 8 | util.request({ 9 | url: 'https://referer.test.whistlejs.com/index.html', 10 | method: 'post' 11 | }, function(res, data) { 12 | data.headers.should.have.property('referer', 'xxx'); 13 | }); 14 | }; 15 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/replaceStatus.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('http://replacestatus.test.whistlejs.com/index.html', function(res, data) { 5 | res.statusCode.should.equal(500); 6 | }); 7 | 8 | util.request({ 9 | method: 'post', 10 | url: 'https://replacestatus.test.whistlejs.com/index.html' 11 | }, function(res, data) { 12 | res.statusCode.should.equal(500); 13 | }); 14 | }; 15 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/req.prepend.body.append.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request({ 5 | url: 'https://reqprepend.reqbody.reqappend.test.whistlejs.com/', 6 | method: 'post' 7 | }, function(res, data) { 8 | data.body.should.equal('prependbodyappend'); 9 | }); 10 | 11 | util.request({ 12 | url: 'http://reqprepend.reqbody.reqappend.test.whistlejs.com/', 13 | method: 'post' 14 | }, function(res, data) { 15 | data.body.should.equal('prependbodyappend'); 16 | }); 17 | }; 18 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/reqAppend.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request({ 5 | url: 'https://reqappend.test.whistlejs.com/', 6 | method: 'post' 7 | }, function(res, data) { 8 | data.body.should.equal('append\r\nappend'); 9 | }); 10 | 11 | util.request({ 12 | url: 'http://reqappend.test.whistlejs.com/', 13 | method: 'post' 14 | }, function(res, data) { 15 | data.body.should.equal('append\r\nappend'); 16 | }); 17 | }; 18 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/reqBody.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request({ 5 | url: 'https://reqbody.test.whistlejs.com/', 6 | method: 'post' 7 | }, function(res, data) { 8 | data.body.should.equal('body\r\nbody'); 9 | }); 10 | 11 | util.request({ 12 | url: 'http://reqbody.test.whistlejs.com/', 13 | method: 'post' 14 | }, function(res, data) { 15 | data.body.should.equal('body\r\nbody'); 16 | }); 17 | }; 18 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/reqCharset.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('http://reqcharset.test.whistlejs.com/index.html', function(res, data) { 5 | data.headers['content-type'].should.containEql('utf8'); 6 | }); 7 | }; 8 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/reqCookies.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('http://reqcookies.test.whistlejs.com/', function(res, data) { 5 | data.headers.cookie.should.be.equal('test=abc'); 6 | }); 7 | }; 8 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/reqDelay.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | var now = Date.now(); 5 | util.request('http://reqdelay.test.whistlejs.com/', function(res, data) { 6 | now = Date.now() - now; 7 | now.should.above(1000); 8 | }); 9 | }; 10 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/reqPrepend.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request({ 5 | url: 'https://reqprepend.test.whistlejs.com/', 6 | method: 'post' 7 | }, function(res, data) { 8 | data.body.should.equal('prepend'); 9 | }); 10 | 11 | util.request({ 12 | url: 'http://reqprepend.test.whistlejs.com/', 13 | method: 'post' 14 | }, function(res, data) { 15 | data.body.should.equal('prepend'); 16 | }); 17 | }; 18 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/reqReplace.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request({ 5 | url: 'https://reqreplace.test.whistlejs.com/', 6 | method: 'post', 7 | body: 'testxxx' 8 | }, function(res, data) { 9 | data.body.should.equal('abcxxx'); 10 | }); 11 | 12 | util.request({ 13 | url: 'http://reqreplace.test.whistlejs.com/', 14 | method: 'post', 15 | body: 'test123' 16 | }, function(res, data) { 17 | data.body.should.equal('abc123'); 18 | }); 19 | }; 20 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/reqSpeed.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | var now = Date.now(); 5 | util.request({ 6 | url: 'http://reqspeed.test.whistlejs.com/', 7 | method: 'post', 8 | body: util.getTextBySize(128 * 2 + 1) 9 | }, function(res, data) { 10 | now = Date.now() - now; 11 | now.should.above(2000); 12 | }); 13 | }; 14 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/reqType.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('http://restype.test.whistlejs.com/index.html', function(res, data) { 5 | res.headers.should.have.property('content-type', 'text/html'); 6 | }); 7 | }; 8 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/res.prepend.body.append.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request({ 5 | url: 'https://resprepend.resbody.resappend.test.whistlejs.com/?resBody=', 6 | method: 'post' 7 | }, function(res, body) { 8 | body.should.equal('prependbodyappend'); 9 | }); 10 | 11 | util.request('http://resprepend.resbody.resappend.test.whistlejs.com/?resBody=', function(res, body) { 12 | body.should.equal('prependbodyappend'); 13 | }); 14 | }; 15 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/resAppend.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request({ 5 | url: 'https://resappend.test.whistlejs.com/?resBody=', 6 | method: 'post' 7 | }, function(res, body) { 8 | body.should.equal('append\r\nappend'); 9 | }); 10 | 11 | util.request('http://resappend.test.whistlejs.com/?resBody=', function(res, body) { 12 | body.should.equal('append\r\nappend'); 13 | }); 14 | }; 15 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/resBody.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('https://resbody.test.whistlejs.com/?resBody=', function(res, body) { 5 | body.should.equal('body\r\nbody'); 6 | }); 7 | 8 | util.request({ 9 | url: 'https://resbody.test.whistlejs.com/?resBody=', 10 | method: 'post' 11 | }, function(res, body) { 12 | body.should.equal('body\r\nbody'); 13 | }); 14 | }; 15 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/resCharset.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('http://rescharset.test.whistlejs.com/index.html', function(res, data) { 5 | res.headers['content-type'].should.containEql('utf8'); 6 | }); 7 | }; 8 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/resCookies.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('http://rescookies.test.whistlejs.com/', function(res, data) { 5 | res.headers['set-cookie'].should.containEql('key2=value2'); 6 | }); 7 | }; 8 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/resDelay.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | var now = Date.now(); 5 | util.request('http://resdelay.test.whistlejs.com/', function(res, data) { 6 | now = Date.now() - now; 7 | now.should.above(1000); 8 | }); 9 | }; 10 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/resPrepend.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request({ 5 | url: 'http://resprepend.test.whistlejs.com/?resBody=', 6 | method: 'post' 7 | }, function(res, body) { 8 | body.should.equal('prepend'); 9 | }); 10 | 11 | util.request('https://resprepend.test.whistlejs.com/?resBody=', function(res, body) { 12 | body.should.equal('prepend'); 13 | }); 14 | }; 15 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/resReplace.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request({ 5 | url: 'https://resreplace.test.whistlejs.com/?resBody=123test', 6 | method: 'post' 7 | }, function(res, body) { 8 | body.should.equal('123abc'); 9 | }); 10 | 11 | util.request('http://resreplace.test.whistlejs.com/?resBody=test123', function(res, body) { 12 | body.should.equal('abc123'); 13 | }); 14 | }; 15 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/resSpeed.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | var now = Date.now(); 5 | util.request({ 6 | url: 'http://resspeed.test.whistlejs.com/', 7 | body: util.getTextBySize(128 * 2 + 1), 8 | method: 'post' 9 | }, function(res, data) { 10 | now = Date.now() - now; 11 | now.should.above(2000); 12 | }); 13 | }; 14 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/resType.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('http://reqtype.test.whistlejs.com/index.html', function(res, data) { 5 | data.headers.should.have.property('content-type', 'text/plain'); 6 | }); 7 | }; 8 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/rulesFile.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('http://rf1.w2.org/index.html', function(res, data) { 5 | data.should.have.property('test', 'values'); 6 | }); 7 | util.request('http://rf2.w2.org/index.html', function(res, data) { 8 | data.should.have.property('test', 'values2'); 9 | }); 10 | util.request('http://rf3.w2.org/index.html', function(res, data) { 11 | data.should.have.property('test', 'values3'); 12 | }); 13 | }; 14 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/script.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('http://reqscript.w2.org/index.html?doNotParseJson', function(res, data) { 5 | data.should.have.equal('123'); 6 | res.headers['x-test'].should.have.equal('123'); 7 | }); 8 | util.request({ 9 | url: 'http://reqscript.w2.org/index.html?doNotParseJson', 10 | method: 'POST', 11 | body: 'test' 12 | }, function(res, data) { 13 | data.should.have.equal('test'); 14 | res.headers['x-test'].should.have.equal('test'); 15 | }); 16 | }; 17 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/ssi-include.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('http://ssi-include.whistlejs.com/index.html?doNotParseJson', function(res, data) { 5 | data.should.be.containEql('include1.html'); 6 | data.should.be.containEql('include2.html'); 7 | data.should.be.containEql('include3.html'); 8 | }); 9 | }; 10 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/tunnelPolicy.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('https://tp.w2.org/index.html', function(res, data, err) { 5 | data.ruleValue.should.be.equal('global'); 6 | res.headers['content-type'].should.be.equal('text/html'); 7 | }); 8 | 9 | util.request({ 10 | method: 'post', 11 | url: 'https://tp.w2.org/index.html', 12 | isTunnel: true 13 | }, function(res, data, err) { 14 | data.body.should.be.equal('test'); 15 | (res.headers['content-type'] | '').should.not.be.equal('text/html'); 16 | }); 17 | }; 18 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/ua.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('http://ua.test.whistlejs.com/index.html', function(res, data) { 5 | data.headers.should.have.property('user-agent', 'xxx'); 6 | }); 7 | 8 | util.request('https://ua.test.whistlejs.com/index.html', function(res, data) { 9 | data.headers.should.have.property('user-agent', 'xxx'); 10 | }); 11 | }; 12 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/urlParams.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('http://urlparams.test.whistlejs.com/index.html', function(res, data) { 5 | // data.url.substring(data.url.indexOf('?') + 1).should.equal('test=abc'); 6 | }); 7 | 8 | util.request({ 9 | method: 'post', 10 | url: 'http://urlparams.test.whistlejs.com/index.html' 11 | }, function(res, data) { 12 | // data.url.substring(data.url.indexOf('?') + 1).should.equal('test=abc'); 13 | }); 14 | }; 15 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/urlReplace.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('http://urlreplace.host.test.whistlejs.com/index.html?name=aven&test=abc', function(res, data) { 5 | data.url.should.equal('/index.html?user=ttven&test=ttbc'); 6 | }); 7 | 8 | util.request({ 9 | method: 'post', 10 | url: 'http://urlreplace.host.test.whistlejs.com/index.html?name=aven&test=abc' 11 | }, function(res, data) { 12 | data.url.should.equal('/index.html?user=ttven&test=ttbc'); 13 | }); 14 | }; 15 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/var.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('http://var1.wproxy.org/index.html', function(res, data) { 5 | data.should.have.property('json1', 1); 6 | data.should.have.property('json2', 2); 7 | data.should.have.property('json3', 3); 8 | }); 9 | }; 10 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/write.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('http://reqwrite.test.whistlejs.com/index.html'); 5 | util.request({ 6 | url: 'https://reqwrite.test.whistlejs.com/index.html', 7 | method: 'post', 8 | body: util.getTextBySize(32) 9 | }); 10 | 11 | util.request('https://reswrite2.test.whistlejs.com/index.html'); 12 | util.request({ 13 | url: 'http://reswrite2.test.whistlejs.com/index.html', 14 | method: 'post', 15 | body: util.getTextBySize(128) 16 | }); 17 | }; 18 | -------------------------------------------------------------------------------- /vendor/whistle/test/units/xfile.test.js: -------------------------------------------------------------------------------- 1 | var util = require('../util.test'); 2 | 3 | module.exports = function() { 4 | util.request('http://xfile.test.whistlejs.com/index2.html', function(res, data) { 5 | data.should.have.property('type', 'server'); 6 | }); 7 | }; 8 | -------------------------------------------------------------------------------- /vendor/win_proxy_helper/MConsole.bas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/win_proxy_helper/MConsole.bas -------------------------------------------------------------------------------- /vendor/win_proxy_helper/win_proxy_helper.vbp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/lightproxy/5da093d7151d8f58202c7ce3da3463dcb9ecb63b/vendor/win_proxy_helper/win_proxy_helper.vbp -------------------------------------------------------------------------------- /vendor/win_proxy_helper/win_proxy_helper.vbw: -------------------------------------------------------------------------------- 1 | WinProxyHelper = 0, 0, 0, 0, C 2 | Con = 0, 0, 0, 0, C 3 | -------------------------------------------------------------------------------- /webpack/webpack.base.config.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const path = require('path'); 4 | 5 | module.exports = { 6 | mode: 'development', 7 | output: { 8 | path: path.resolve(__dirname, '../app/dist'), 9 | filename: '[name].js', 10 | }, 11 | node: { 12 | __dirname: false, 13 | __filename: false, 14 | }, 15 | resolve: { 16 | extensions: ['.tsx', '.ts', '.js', '.json'], 17 | }, 18 | devtool: 'source-map', 19 | plugins: [], 20 | }; 21 | -------------------------------------------------------------------------------- /webpack/webpack.main.prod.config.js: -------------------------------------------------------------------------------- 1 | const merge = require('webpack-merge'); 2 | 3 | const baseConfig = require('./webpack.main.config'); 4 | 5 | module.exports = merge.smart(baseConfig, { 6 | mode: 'production', 7 | }); 8 | -------------------------------------------------------------------------------- /webpack/webpack.renderer.prod.config.js: -------------------------------------------------------------------------------- 1 | const merge = require('webpack-merge'); 2 | const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; 3 | 4 | const baseConfig = require('./webpack.renderer.config'); 5 | 6 | if (process.env.BUNDLE_ANALYZER) { 7 | baseConfig.plugins.push(new BundleAnalyzerPlugin()); 8 | } 9 | 10 | module.exports = merge.smart(baseConfig, { 11 | mode: 'production', 12 | }); 13 | --------------------------------------------------------------------------------