whistle 2.9.44 → 2.9.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/assets/menu.html +1 -0
- package/assets/tab.html +1 -0
- package/bin/util.js +7 -2
- package/biz/webui/htdocs/index.html +1 -1
- package/biz/webui/htdocs/js/index.js +45 -45
- package/lib/config.js +5 -6
- package/lib/handlers/file-proxy.js +14 -9
- package/lib/inspectors/req.js +64 -66
- package/lib/inspectors/res.js +366 -401
- package/lib/rules/index.js +1 -0
- package/lib/rules/rules.js +12 -4
- package/lib/tunnel.js +26 -22
- package/lib/util/index.js +28 -56
- package/lib/util/whistle-transform.js +54 -11
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
# whistle
|
|
8
8
|
[](https://npmjs.org/package/whistle)
|
|
9
9
|
[](http://nodejs.org/download/)
|
|
10
|
-
[](https://travis-ci.org/avwo/whistle)
|
|
11
10
|
[](https://codecov.io/gh/avwo/whistle)
|
|
12
11
|
[](https://npmjs.org/package/whistle)
|
|
13
12
|
[](https://www.npmjs.com/package/whistle)
|
|
@@ -35,6 +34,8 @@ Whistle 是基于 Node 实现的跨平台抓包调试工具,其主要特点:
|
|
|
35
34
|
npm i -g whistle && w2 start --init
|
|
36
35
|
```
|
|
37
36
|
> 上述命令会先全局安装 Whistle 的 npm 包后,启动 Whistle 并设置系统全局代理,以及安装系统根证书,目前一键安装只支持 Mac & Windows 系统,其它系统按照下面 **手动安装** 的方式操作。
|
|
37
|
+
>
|
|
38
|
+
> 如果安装过程时报错 `Bad CPU type in executable`,在命令执行 `arch -x86_64 zsh` 再重新执行一键安装命令。
|
|
38
39
|
3. 一键安装过程中注意事项:
|
|
39
40
|
* Mac 需要两次输入开机密码或指纹验证
|
|
40
41
|
<p>
|
|
@@ -68,6 +69,10 @@ Whistle 是基于 Node 实现的跨平台抓包调试工具,其主要特点:
|
|
|
68
69
|
### 详细用法参见:[Whistle 帮助文档](https://wproxy.org/whistle/quickstart.html)
|
|
69
70
|
|
|
70
71
|
# 通过 SwitchyOmega 设置代理
|
|
72
|
+
### 安装 SwitchyOmega
|
|
73
|
+
打开 Chrome 扩展商店进行安装 https://chrome.google.com/webstore/detail/proxy-switchyomega/padekgcemlokbadohgkifijomclgjgif
|
|
74
|
+
|
|
75
|
+
### 配置 SwitchyOmega
|
|
71
76
|
全局代理如果会影响到某些客户端的请求(客户端设置了 ssl pinning),也可以使用 Chrome 插件设置代理(只对 Chrome 生效):
|
|
72
77
|
> 可以通过 `w2 proxy off` 关闭全局代理
|
|
73
78
|
|
package/assets/menu.html
CHANGED
|
@@ -157,6 +157,7 @@
|
|
|
157
157
|
Object.keys(options.msgBox).forEach(function(name) {
|
|
158
158
|
toast[name] = options.msgBox[name];
|
|
159
159
|
});
|
|
160
|
+
whistleBridge.copyText = options.copyText;
|
|
160
161
|
whistleBridge.pageId = options.pageId;
|
|
161
162
|
whistleBridge.compose = options.compose;
|
|
162
163
|
whistleBridge.decodeBase64 = options.decodeBase64;
|
package/assets/tab.html
CHANGED
|
@@ -282,6 +282,7 @@
|
|
|
282
282
|
});
|
|
283
283
|
getActiveSession = options.getActiveSession;
|
|
284
284
|
getSelectedSessionList = options.getSelectedSessionList;
|
|
285
|
+
whistleBridge.copyText = options.copyText;
|
|
285
286
|
whistleBridge.pageId = options.pageId;
|
|
286
287
|
whistleBridge.compose = options.compose;
|
|
287
288
|
whistleBridge.decodeBase64 = options.decodeBase64;
|
package/bin/util.js
CHANGED
|
@@ -64,6 +64,10 @@ function showKillError() {
|
|
|
64
64
|
|
|
65
65
|
exports.showKillError = showKillError;
|
|
66
66
|
|
|
67
|
+
function getIpHost(ip) {
|
|
68
|
+
return ip.indexOf(':') === -1 ? ip : '[' + ip + ']';
|
|
69
|
+
}
|
|
70
|
+
|
|
67
71
|
function showUsage(isRunning, options, restart) {
|
|
68
72
|
options = formatOptions(options);
|
|
69
73
|
if (isRunning) {
|
|
@@ -79,7 +83,7 @@ function showUsage(isRunning, options, restart) {
|
|
|
79
83
|
var list = options.host ? [options.host] : getIpList();
|
|
80
84
|
info('[i] 1. use your device to visit the following URL list, gets the ' + colors.bold('IP') + ' of the URL you can access:');
|
|
81
85
|
info(list.map(function(ip) {
|
|
82
|
-
return ' http://' + colors.bold(ip) + (port && port != 80 ? ':' + port : '') + '/';
|
|
86
|
+
return ' http://' + colors.bold(getIpHost(ip)) + (port && port != 80 ? ':' + port : '') + '/';
|
|
83
87
|
}).join('\n'));
|
|
84
88
|
|
|
85
89
|
warn(' Note: If all the above URLs are unable to access, check the firewall settings');
|
|
@@ -108,7 +112,8 @@ function getDataDir() {
|
|
|
108
112
|
}
|
|
109
113
|
|
|
110
114
|
function formatOptions(options) {
|
|
111
|
-
if (!options || !/^(?:([\w.-]+):)?([1-9]\d{0,4})$/.test(options.port)
|
|
115
|
+
if (!options || (!/^(?:([\w.-]+):)?([1-9]\d{0,4})$/.test(options.port) &&
|
|
116
|
+
!/^\[([\w.:]+)\]:([1-9]\d{0,4})$/.test(options.port))) {
|
|
112
117
|
return options;
|
|
113
118
|
}
|
|
114
119
|
options.host = options.host || RegExp.$1;
|