Skip to content

Commit 0b4e1df

Browse files
committed
Merge commit 'd0f652e3be157d5cfa4666eec97515af80decaa9'
2 parents 1933d89 + d0f652e commit 0b4e1df

File tree

108 files changed

+2565
-1010
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+2565
-1010
lines changed

vendor/whistle/.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ node_modules
44
/test/assets/values
55
/test/plugins/whistle.test/assets
66
/bin/import.js
7+
/test/all_whistles

vendor/whistle/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,4 @@ _book
6565
dist
6666
/.history
6767
/test/temp_files
68+
/test/all_whistles

vendor/whistle/CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# v2.9.97
2+
1. feat: 导入 Rules 和 Values 的交互调整,允许用户手动选择需要导入的内容
3+
2. feat: 安装插件功能优化
4+
3. feat: 支持通过 `lineProps://internal` 将规则作用于 Whistle 内部请求(只支持 host、proxy 等部分规则)
5+
6+
# v2.9.96
7+
1. feat: 支持导出指定规则项
8+
9+
# v2.9.95
10+
1. feat: JSON Viewer 的右键菜单支持 Copy 选中的文本
11+
2. feat: Composer 历史列表添加右键菜单
12+
3. feat: 优化界面及性能
13+
4. feat: 支持通过插件安装插件,实现方式参考:https://github.com/whistle-plugins/whistle.installer
14+
5. feat: 支持通过界面卸载插件
15+
116
# v2.9.94
217
1. fix: https://github.com/avwo/whistle/pull/1192
318

vendor/whistle/README-en_US.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
[中文](./README-zh_CN.md) · English
1616

17-
Whistle is a simple and powerful cross-platform packet capture and debugging tool based on Node.JS. It can be used as **HTTP proxy (default)**, **HTTPS proxy**, **Socks proxy**, **reverse proxy**, etc., for **packet capture analysis** or **modification through configuration rules** of HTTP, HTTPS, HTTP/2, WebSocket, TCP requests. It also has built-in **Weinre**, **Log**, **Composer** and other tools to view the DOM structure of remote pages, view console output content, replay and edit construction requests, etc. It also supports **plug-in extension functions** or **referenced by projects as NPM packages**.
17+
Whistle is a powerful and easy-to-use cross-platform packet capture and debugging tool developed based on Node.js. It supports multiple proxy modes (such as HTTP, HTTPS, Socks, reverse proxy, etc.), which can be used for packet capture analysis or modifying HTTP, HTTPS, HTTP/2, WebSocket, TCP requests through configuration rules. Whistle also has built-in tools such as Weinre, Log, Composer, etc., which support viewing the DOM structure of remote pages, debugging console output, replaying or editing requests, etc. In addition, Whistle supports plug-in extensions and can also be referenced by other projects as NPM packages.
1818

1919
# Installation
2020

vendor/whistle/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
</a>
55
</p>
66

7-
# Whistle
7+
# whistle
88

99
[![NPM version](https://img.shields.io/npm/v/whistle.svg?style=flat-square)](https://npmjs.org/package/whistle)
1010
[![node version](https://img.shields.io/badge/node.js->=_8-green.svg?style=flat-square)](http://nodejs.org/download/)
@@ -15,7 +15,7 @@
1515

1616
中文 · [English](./README-en_US.md)
1717

18-
Whistle 是基于 Node.JS 实现的操作简单、功能强大的跨平台抓包调试工具,可作为 **HTTP 代理(默认)****HTTPS 代理****Socks 代理****反向代理**等,用于**抓包分析****通过配置规则修改** HTTP、HTTPS、HTTP/2、WebSocket、TCP 请求,且内置 **Weinre****Log****Composer** 等工具可查看远程页面的 DOM 结构、查看 console 输出内容、重放编辑构造请求等,并支持 **插件扩展功能****作为 NPM 包被项目引用**
18+
Whistle 是一个基于 Node.js 开发的功能强大、操作简单的跨平台抓包调试工具。它支持多种代理模式(如 HTTPHTTPSSocks、反向代理等),可用于抓包分析或通过配置规则修改 HTTP、HTTPS、HTTP/2、WebSocket、TCP 请求。Whistle 还内置了 WeinreLogComposer 等工具,支持查看远程页面的 DOM 结构、调试 console 输出、重放或编辑请求等。此外,Whistle 支持插件扩展,也可作为 NPM 包被其他项目引用
1919

2020
# 安装
2121

vendor/whistle/assets/js/log.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@
268268
}
269269

270270
function getPageInfo() {
271-
return '\r\nPage Url: ' + location.href + '\r\nUser Agent: ' + navigator.userAgent;
271+
return '\r\nPage URL: ' + location.href + '\r\nUser Agent: ' + navigator.userAgent;
272272
}
273273

274274
function getErrorStack(error, message) {

vendor/whistle/assets/menu.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
return;
163163
}
164164
}
165-
165+
166166
var whistleBridge = {
167167
config: config,
168168
toast: toast,
@@ -202,8 +202,11 @@
202202
whistleBridge.download = options.download;
203203
whistleBridge.setNetworkSettings = options.setNetworkSettings;
204204
whistleBridge.setComposerData = options.setComposerData;
205+
whistleBridge.showHttpsSettings = options.showHttpsSettings;
206+
whistleBridge.showCustomCerts = options.showCustomCerts;
205207
whistleBridge.request = options.request;
206208
whistleBridge.createRequest = options.createRequest;
209+
whistleBridge.parseRules = options.parseRules;
207210
whistleBridge.showModal = options.showModal;
208211
whistleBridge.createModal = options.createModal;
209212
whistleBridge.importRules = options.importRules;

vendor/whistle/assets/modal.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,11 @@
2525
whistleBridge.download = options.download;
2626
whistleBridge.setNetworkSettings = options.setNetworkSettings;
2727
whistleBridge.setComposerData = options.setComposerData;
28+
whistleBridge.showHttpsSettings = options.showHttpsSettings;
29+
whistleBridge.showCustomCerts = options.showCustomCerts;
2830
whistleBridge.request = options.request;
2931
whistleBridge.createRequest = options.createRequest;
32+
whistleBridge.parseRules = options.parseRules;
3033
whistleBridge.showModal = options.showModal;
3134
whistleBridge.importRules = options.importRules;
3235
whistleBridge.importValues = options.importValues;

vendor/whistle/assets/tab.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
var addSessionCompleteListener = getAddEventHandler(3);
155155
var removeSessionCompleteListener = getRemoveEventListener(3);
156156
var removeSessionCompleteListeners = getRemoveEventListeners(3);
157-
157+
158158
function on(type, l) {
159159
if (typeof l !== 'function') {
160160
return;
@@ -295,8 +295,11 @@
295295
whistleBridge.download = options.download;
296296
whistleBridge.setNetworkSettings = options.setNetworkSettings;
297297
whistleBridge.setComposerData = options.setComposerData;
298+
whistleBridge.showHttpsSettings = options.showHttpsSettings;
299+
whistleBridge.showCustomCerts = options.showCustomCerts;
298300
whistleBridge.request = options.request;
299301
whistleBridge.createRequest = options.createRequest;
302+
whistleBridge.parseRules = options.parseRules;
300303
whistleBridge.showModal = options.showModal;
301304
whistleBridge.getSelectedSessionList = getSelectedSessionList;
302305
whistleBridge.getActiveSession = whistleBridge.getSession = whistleBridge.getSelectedSession = getActiveSession;

vendor/whistle/bin/plugin.js

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,43 @@ function formatCmdOpions(options) {
4545
return options;
4646
}
4747

48+
function getValue(str) {
49+
if (str[0] !== '"') {
50+
return str;
51+
}
52+
var len = str.length - 1;
53+
return str[len] === '"' ? str.substring(1, len) : str;
54+
}
55+
56+
function parseDir(dir) {
57+
if (!dir) {
58+
return;
59+
}
60+
dir = getValue(dir);
61+
if (/^~(~)?(?:$|[\/])/.test(dir)) {
62+
var wave = RegExp.$1;
63+
var all = RegExp['$&'];
64+
return path.resolve(wave ? getWhistlePath() : commonUtil.getHomedir(), dir.substring(all.length));
65+
}
66+
if (commonUtil.isWhistleName(dir)) {
67+
return path.resolve(getWhistlePath(), 'all_whistles/' + dir + '/custom_plugins');
68+
}
69+
return path.resolve(dir);
70+
}
71+
4872
function getInstallDir(argv) {
4973
argv = argv.slice();
5074
var result = { argv: argv };
5175
for (var i = 0, len = argv.length; i < len; i++) {
5276
var option = argv[i];
77+
if (option === '--dir') {
78+
result.dir = parseDir(argv[i + 1]);
79+
argv.splice(i, 2);
80+
return result;
81+
}
5382
if (option && option.indexOf('--dir=') === 0) {
5483
var dir = option.substring(option.indexOf('=') + 1);
55-
result.dir = dir && path.resolve(dir);
84+
result.dir = parseDir(dir);
5685
argv.splice(i, 1);
5786
return result;
5887
}
@@ -222,7 +251,7 @@ exports.install = function(cmd, argv) {
222251
argv = argv.filter(function(name) {
223252
return plugins.indexOf(name) === -1;
224253
});
225-
254+
226255
cmd += CMD_SUFFIX;
227256
argv.push('--no-package-lock');
228257
installPlugins(cmd, plugins, argv, {});

0 commit comments

Comments
 (0)