whistle 2.10.2 → 2.10.3

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/assets/menu.html CHANGED
@@ -189,6 +189,8 @@
189
189
  toast[name] = options.msgBox[name];
190
190
  });
191
191
  whistleBridge.getSelectedSessionList = options.getSelectedSessionList;
192
+ whistleBridge.getRawRequest = options.getRawRequest;
193
+ whistleBridge.getRawResponse = options.getRawResponse;
192
194
  whistleBridge.getActiveSession = whistleBridge.getSession = whistleBridge.getSelectedSession = options.getActiveSession;
193
195
  whistleBridge.showOption = options.showOption;
194
196
  whistleBridge.hideOption = options.hideOption;
package/assets/modal.html CHANGED
@@ -12,6 +12,8 @@
12
12
  toast[name] = options.msgBox[name];
13
13
  });
14
14
  whistleBridge.getSelectedSessionList = options.getSelectedSessionList;
15
+ whistleBridge.getRawRequest = options.getRawRequest;
16
+ whistleBridge.getRawResponse = options.getRawResponse;
15
17
  whistleBridge.getActiveSession = whistleBridge.getSession = whistleBridge.getSelectedSession = options.getActiveSession;
16
18
  whistleBridge.showOption = options.showOption;
17
19
  whistleBridge.hideOption = options.hideOption;
package/assets/tab.html CHANGED
@@ -5,7 +5,6 @@
5
5
  var activeList = [];
6
6
  var stateList = [1];
7
7
  var getActiveSession;
8
- var getSelectedSessionList;
9
8
  var listenersList = [];
10
9
  var frameChangeListeners = [];
11
10
  var composeListeners = [];
@@ -282,7 +281,9 @@
282
281
  toast[name] = options.msgBox[name];
283
282
  });
284
283
  getActiveSession = options.getActiveSession;
285
- getSelectedSessionList = options.getSelectedSessionList;
284
+ whistleBridge.getSelectedSessionList = options.getSelectedSessionList;
285
+ whistleBridge.getRawRequest = options.getRawRequest;
286
+ whistleBridge.getRawResponse = options.getRawResponse;
286
287
  whistleBridge.showOption = options.showOption;
287
288
  whistleBridge.hideOption = options.hideOption;
288
289
  whistleBridge.updateUI = options.updateUI;
@@ -324,7 +325,6 @@
324
325
  whistleBridge.createRequest = options.createRequest;
325
326
  whistleBridge.parseRules = options.parseRules;
326
327
  whistleBridge.showModal = options.showModal;
327
- whistleBridge.getSelectedSessionList = getSelectedSessionList;
328
328
  whistleBridge.getActiveSession = whistleBridge.getSession = whistleBridge.getSelectedSession = getActiveSession;
329
329
  whistleBridge.importRules = options.importRules;
330
330
  whistleBridge.importValues = options.importValues;
package/bin/whistle.js CHANGED
@@ -129,7 +129,7 @@ program
129
129
  .description('Display running status');
130
130
  program
131
131
  .command('add')
132
- .description('Add rules from local JS file (.whistle.js by default)');
132
+ .description('Add rules from local JS file (default: .whistle.js in current directory)');
133
133
  program.command('proxy')
134
134
  .description('Configure system proxy settings');
135
135
  program.command('ca')
@@ -144,18 +144,18 @@ program.command('exec')
144
144
  program
145
145
  .option('-D, --baseDir [baseDir]', 'set storage root path', String, undefined)
146
146
  .option('-z, --certDir [directory]', 'set custom certificate directory', String, undefined)
147
- .option('-l, --localUIHost [hostname]', 'set web UI domain (' + config.localUIHost + ' by default)', String, undefined)
148
- .option('-L, --pluginHost [hostname]', 'set plugin UI domains (as: "script=a.b.com&vase=x.y.com")', String, undefined)
147
+ .option('-l, --localUIHost [hostname]', 'set web UI domain (default: ' + config.localUIHost + ')', String, undefined)
148
+ .option('-L, --pluginHost [hostname]', 'set plugin UI domains (e.g., "script=a.b.com&vase=x.y.com")', String, undefined)
149
149
  .option('-n, --username [username]', 'set web UI username', String, undefined)
150
150
  .option('-w, --password [password]', 'set web UI password', String, undefined)
151
151
  .option('-N, --guestName [username]', 'set web UI guest username (read-only)', String, undefined)
152
152
  .option('-W, --guestPassword [password]', 'set web UI guest password (read-only)', String, undefined)
153
- .option('-s, --sockets [number]', 'set max cached connections per domain (' + config.sockets + ' by default)', parseInt, undefined)
153
+ .option('-s, --sockets [number]', 'set max cached connections per domain (default: ' + config.sockets + ')', parseInt, undefined)
154
154
  .option('-S, --storage [newStorageDir]', 'set configuration storage directory', String, undefined)
155
155
  .option('-C, --copy [storageDir]', 'copy configuration from specified directory', String, undefined)
156
156
  .option('-c, --dnsCache [time]', 'set DNS cache time (default: 60000ms)', String, undefined)
157
157
  .option('-H, --host [boundHost]', 'set bound host (default: INADDR_ANY)', String, undefined)
158
- .option('-p, --port [proxyPort]', 'set proxy port (default: ' + config.port + ' by default)', String, undefined)
158
+ .option('-p, --port [proxyPort]', 'set proxy port (default: ' + config.port + ')', String, undefined)
159
159
  .option('-P, --uiport [uiport]', 'set web UI port', String, undefined)
160
160
  .option('-m, --middlewares [script path or module name]', 'set startup middlewares (format: xx,yy/zz.js)', String, undefined)
161
161
  .option('-M, --mode [mode]', 'set startup mode (options: pureProxy|debug|multiEnv|capture|disableH2|network|rules|plugins|prod)', String, undefined)
@@ -17,7 +17,7 @@ module.exports = function(req, res) {
17
17
  }
18
18
 
19
19
  if (!filename || typeof filename !== 'string') {
20
- filename = (type === 'mock' ? 'mock_' : 'text_') + util.formatDate() + suffix;
20
+ filename = (type === 'mock' ? 'rules_items_' : 'text_') + util.formatDate() + suffix;
21
21
  } else if (!/\.\w+$/.test(filename)) {
22
22
  filename += suffix;
23
23
  }
@@ -0,0 +1,7 @@
1
+ var clearDnsCache = require('../../../../lib/rules/dns').clearCache;
2
+
3
+ module.exports = function(req, res) {
4
+ clearDnsCache();
5
+ res.json({ec: 0, em: 'success'});
6
+ };
7
+
@@ -8,6 +8,6 @@
8
8
  </head>
9
9
  <body>
10
10
  <div id="container" class="main"></div>
11
- <script src="js/index.js?v=2.10.2"></script>
11
+ <script src="js/index.js?v=2.10.3"></script>
12
12
  </body>
13
13
  </html>