whistle 2.9.97 → 2.9.98

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
@@ -204,6 +204,13 @@
204
204
  whistleBridge.setComposerData = options.setComposerData;
205
205
  whistleBridge.showHttpsSettings = options.showHttpsSettings;
206
206
  whistleBridge.showCustomCerts = options.showCustomCerts;
207
+ whistleBridge.showService = options.showService;
208
+ whistleBridge.hideService = options.hideService;
209
+ whistleBridge.showInstallPlugins = options.showInstallPlugins;
210
+ whistleBridge.showUpdatePlugins = options.showUpdatePlugins;
211
+ whistleBridge.readFileAsText = options.readFileAsText;
212
+ whistleBridge.readFileAsBase64 = options.readFileAsBase64;
213
+ whistleBridge.getVersion = options.getVersion;
207
214
  whistleBridge.request = options.request;
208
215
  whistleBridge.createRequest = options.createRequest;
209
216
  whistleBridge.parseRules = options.parseRules;
package/assets/modal.html CHANGED
@@ -27,6 +27,13 @@
27
27
  whistleBridge.setComposerData = options.setComposerData;
28
28
  whistleBridge.showHttpsSettings = options.showHttpsSettings;
29
29
  whistleBridge.showCustomCerts = options.showCustomCerts;
30
+ whistleBridge.showService = options.showService;
31
+ whistleBridge.hideService = options.hideService;
32
+ whistleBridge.showInstallPlugins = options.showInstallPlugins;
33
+ whistleBridge.showUpdatePlugins = options.showUpdatePlugins;
34
+ whistleBridge.readFileAsText = options.readFileAsText;
35
+ whistleBridge.readFileAsBase64 = options.readFileAsBase64;
36
+ whistleBridge.getVersion = options.getVersion;
30
37
  whistleBridge.request = options.request;
31
38
  whistleBridge.createRequest = options.createRequest;
32
39
  whistleBridge.parseRules = options.parseRules;
package/assets/tab.html CHANGED
@@ -297,6 +297,13 @@
297
297
  whistleBridge.setComposerData = options.setComposerData;
298
298
  whistleBridge.showHttpsSettings = options.showHttpsSettings;
299
299
  whistleBridge.showCustomCerts = options.showCustomCerts;
300
+ whistleBridge.showService = options.showService;
301
+ whistleBridge.hideService = options.hideService;
302
+ whistleBridge.showInstallPlugins = options.showInstallPlugins;
303
+ whistleBridge.showUpdatePlugins = options.showUpdatePlugins;
304
+ whistleBridge.readFileAsText = options.readFileAsText;
305
+ whistleBridge.readFileAsBase64 = options.readFileAsBase64;
306
+ whistleBridge.getVersion = options.getVersion;
300
307
  whistleBridge.request = options.request;
301
308
  whistleBridge.createRequest = options.createRequest;
302
309
  whistleBridge.parseRules = options.parseRules;
package/bin/ca/cli.js CHANGED
@@ -16,9 +16,9 @@ var MAX_LEN = 1024 * 1024;
16
16
  function installCert(certFile, url) {
17
17
  try {
18
18
  installRootCA(fileMgr.convertSlash(certFile));
19
- util.info('Install root CA (' + (url || certFile) + ') successful.');
19
+ util.info('Successfully installed Root CA from (' + (url || certFile) + ').');
20
20
  } catch (e) {
21
- util.error(e.message);
21
+ util.error('Certificate installation failed: ' + e.message);
22
22
  }
23
23
  }
24
24
 
@@ -39,7 +39,7 @@ function install(addr) {
39
39
  return util.error('Bad response (' + res.statusCode + ').');
40
40
  }
41
41
  if (!body || !body.length) {
42
- return util.error('No content.');
42
+ return util.error('Empty certificate content.');
43
43
  }
44
44
  var tempFile = path.join(commonUtil.getWhistlePath(), Date.now() + '-' + util.getHash(addr.url) + '.crt');
45
45
  fs.writeFileSync(tempFile, body);
package/bin/ca/index.js CHANGED
@@ -39,5 +39,5 @@ module.exports = function(certFile) {
39
39
  if (platform === 'win32') {
40
40
  return installWin(certFile);
41
41
  }
42
- throw new Error('Platform ' + platform + ' is unsupported to install root CA for now.');
42
+ throw new Error('Platform ' + platform + ' is currently unsupported for Root CA installation.');
43
43
  };
package/bin/proxy.js CHANGED
@@ -24,9 +24,9 @@ function enableProxy(options) {
24
24
  try {
25
25
  var host = util.joinIpPort(options.host, options.port);
26
26
  if (proxy.enableProxy(options)) {
27
- showInfo('Setting global proxy (' + host + ') successful.');
27
+ showInfo('Successfully set system proxy (' + host + ').');
28
28
  } else {
29
- showError('Failed to set global proxy (' + host + ').');
29
+ showError('Failed to set system proxy (' + host + ').');
30
30
  }
31
31
  } catch (e) {
32
32
  showError(e.message);
@@ -36,9 +36,9 @@ function enableProxy(options) {
36
36
  function disableProxy(sudo) {
37
37
  try {
38
38
  if (proxy.disableProxy(sudo)) {
39
- showInfo('Turn off global proxy successful.');
39
+ showInfo('Successfully disabled system proxy.');
40
40
  } else {
41
- showError('Failed to turn off global proxy.');
41
+ showError('Failed to disable system proxy.');
42
42
  }
43
43
  } catch (e) {
44
44
  showError(e.message);
package/bin/status.js CHANGED
@@ -22,9 +22,9 @@ function showAll(byStop) {
22
22
  });
23
23
  var len = confList.length;
24
24
  if (!len) {
25
- warn('[!] No running whistle.');
25
+ warn('[!] No running Whistle instances.');
26
26
  } else {
27
- var tips = ['[i] All running whistle:'];
27
+ var tips = ['[i] All running Whistle instances:'];
28
28
  confList.forEach(function(conf, i) {
29
29
  ++i;
30
30
  var options = conf.options;
@@ -34,7 +34,7 @@ function showAll(byStop) {
34
34
  + (options.storage ? ', Storage: ' + options.storage : '')
35
35
  + (byStop ? colors.red(' (Stop cmd: ' + (options.storage ? 'w2 stop -S ' + options.storage : 'w2 stop') + ')') : ''));
36
36
  });
37
- byStop && warn('[!] This whistle is not running.');
37
+ byStop && warn('[!] This Whistle instance is not running.');
38
38
  info(tips.join('\n'));
39
39
  }
40
40
  });
package/bin/use.js CHANGED
@@ -19,9 +19,9 @@ var options;
19
19
 
20
20
  function showStartWhistleTips(storage, isClient) {
21
21
  if (isClient) {
22
- error('No running whistle client, please install and start the latest whistle client: https://github.com/avwo/whistle-client');
22
+ error('No running Whistle client. Please install and start the latest Whistle client: https://github.com/avwo/whistle-client');
23
23
  } else {
24
- error('No running whistle, execute `w2 start' + (storage ? ' -S ' + storage : '') + '` to start whistle on the cli.');
24
+ error('No running Whistle instances. Execute `w2 start' + (storage ? ' -S ' + storage : '') + '` to start Whistle on the cli.');
25
25
  }
26
26
  }
27
27
 
@@ -172,17 +172,17 @@ module.exports = function(filepath, storage, force, isClient) {
172
172
  }
173
173
  handleRules(filepath, function(result) {
174
174
  if (!result) {
175
- error('The name and rules cannot be empty.');
175
+ error('The name and rules are required.');
176
176
  return;
177
177
  }
178
178
  var name = getString(result.name);
179
179
  if (!name || name.length > 64) {
180
- error('The name cannot be empty and the length cannot exceed 64 characters.');
180
+ error('The name must be 1-64 characters.');
181
181
  return;
182
182
  }
183
183
  var rules = getString(result.rules);
184
184
  if (rules.length > MAX_RULES_LEN) {
185
- error('The rules cannot be empty and the size cannot exceed 256k.');
185
+ error('Maximum rules size: 256KB.');
186
186
  return;
187
187
  }
188
188
  var groupName = getString(result.groupName) || getString(result.group);
@@ -193,7 +193,7 @@ module.exports = function(filepath, storage, force, isClient) {
193
193
  'groupName=' + encodeURIComponent(groupName.trim())
194
194
  ].join('&');
195
195
  request(body, function() {
196
- info('Setting whistle' + (isClient ? ' client' : '') + ' (' + util.joinIpPort(options.host || '127.0.0.1', port) + ') rules successful.');
196
+ info('Successfully configured rules for Whistle' + (isClient ? ' client' : '') + ' (' + util.joinIpPort(options.host || '127.0.0.1', port) + ').');
197
197
  });
198
198
  };
199
199
  if (force) {
@@ -202,7 +202,7 @@ module.exports = function(filepath, storage, force, isClient) {
202
202
  request('name=' + encodeURIComponent(name) + '&enable=1&top=1', function(data) {
203
203
  if (data.rules) {
204
204
  info('Successfully enabled.');
205
- warn('Warning: The rule already exists, to override the content, add CLI option --force.');
205
+ warn('Warning: Rule already exists. Use \'--force\' to override.');
206
206
  return;
207
207
  }
208
208
  setRules();
@@ -210,4 +210,4 @@ module.exports = function(filepath, storage, force, isClient) {
210
210
  }, port);
211
211
  });
212
212
  });
213
- };
213
+ };
package/bin/util.js CHANGED
@@ -14,13 +14,13 @@ var joinIpPort = common.joinIpPort;
14
14
 
15
15
  exports.joinIpPort = joinIpPort;
16
16
  /*eslint no-console: "off"*/
17
- var CHECK_RUNNING_CMD = process.platform === 'win32' ?
17
+ var CHECK_RUNNING_CMD = process.platform === 'win32' ?
18
18
  'tasklist /fi "PID eq %s" | findstr /i "node.exe"'
19
19
  : 'ps -f -p %s | grep "node"';
20
20
  var isWin = process.platform === 'win32';
21
21
 
22
22
  function isRunning(pid, callback) {
23
- pid ? cp.exec(util.format(CHECK_RUNNING_CMD, pid),
23
+ pid ? cp.exec(util.format(CHECK_RUNNING_CMD, pid),
24
24
  function (err, stdout, stderr) {
25
25
  callback(!err && !!stdout.toString().trim());
26
26
  }) : callback();
@@ -64,7 +64,7 @@ exports.info = info;
64
64
 
65
65
  function showKillError() {
66
66
  error('[!] Cannot kill ' + config.name + ' owned by root');
67
- info('[i] Try to run command ' + (isWin ? 'as an administrator' : 'with `sudo`'));
67
+ info('[i] Try to run command ' + (isWin ? 'as an administrator' : 'with sudo'));
68
68
  }
69
69
 
70
70
  exports.showKillError = showKillError;
@@ -87,13 +87,13 @@ function showUsage(isRunning, options, restart) {
87
87
  return ' http://' + colors.bold(joinIpPort(ip, port != 80 && port)) + '/';
88
88
  }).join('\n'));
89
89
 
90
- warn(' Note: If all the above URLs are unable to access, check the firewall settings');
90
+ warn(' Note: If all URLs are inaccessible, check firewall settings');
91
91
  warn(' For help see ' + colors.bold('https://github.com/avwo/whistle'));
92
92
  info('[i] 2. set the HTTP proxy on your device with ' + colors.bold((list.length === 1 ? 'IP(' + list[0] + ')' : 'the above IP') + ' & PORT(' + port + ')'));
93
93
  info('[i] 3. use ' + colors.bold('Chrome') + ' to visit ' + colors.bold('http://' + (options.localUIHost || config.localUIHost) + '/') + ' to get started');
94
94
 
95
95
  if (parseInt(process.version.slice(1), 10) < 6) {
96
- warn(colors.bold('\nWarning: The current Node version is too low, access https://nodejs.org to install the latest version, or may not be able to Capture HTTPS CONNECTS\n'));
96
+ warn(colors.bold('\nWarning: Node version too low. Update at https://nodejs.org to capture HTTPS connections\n'));
97
97
  }
98
98
  var bypass = program.init;
99
99
  if (bypass == null) {
package/bin/whistle.js CHANGED
@@ -34,12 +34,12 @@ function showStartupInfo(err, options, debugMode, restart) {
34
34
  if (/listen EADDRINUSE/.test(err)) {
35
35
  options = util.formatOptions(options);
36
36
  var port = options.port || config.port;
37
- error('[!] Failed to bind proxy port ' + (options.host ? util.joinIpPort(options.host, port) : port) + ': The port is already in use');
38
- info('[i] Please check if ' + config.name + ' is already running, you can ' + (debugMode ? 'stop whistle with `w2 stop` first' : 'restart whistle with `w2 restart`'));
39
- info(' or if another application is using the port, you can change the port with ' + (debugMode ? '`w2 run -p newPort`\n' : '`w2 start -p newPort`\n'));
37
+ error('[!] Failed to bind proxy port ' + (options.host ? util.joinIpPort(options.host, port) : port) + ': Port already in use');
38
+ info('[i] ' + config.name + ' may already be running. Try: ' + (debugMode ? 'w2 stop' : 'w2 restart') + ' to ' + (debugMode ? 'stop' : 'restart') + ' the ' + config.name);
39
+ info(' or use a different port with: ' + (debugMode ? '`w2 run -p newPort`\n' : '`w2 start -p newPort`\n'));
40
40
  } else if (err.code == 'EACCES' || err.code == 'EPERM') {
41
- error('[!] Cannot start ' + config.name + ' owned by root');
42
- info('[i] Try to run command with `sudo`\n');
41
+ error('[!] Permission denied: Cannot start ' + config.name + ' as root');
42
+ info('[i] Try running with sudo\n');
43
43
  }
44
44
 
45
45
  error(err.stack ? 'Date: ' + new Date().toLocaleString() + '\n' + err.stack : err);
@@ -55,9 +55,9 @@ program.setConfig({
55
55
  main: function(options) {
56
56
  var cmd = process.argv[2];
57
57
  if ((cmd === 'start' || cmd === 'restart') && (options.inspect || options.inspectBrk)) {
58
- error('[!] Only support running command `w2 run` to activate inspector on whistle.');
58
+ error('[!] Inspector mode only supported with `w2 run` command.');
59
59
  var argv = Array.prototype.slice.call(process.argv, 3);
60
- info('[i] Try to run command `w2 run' + (argv.length ? ' ' + argv.join(' ') : '') + '` instead of.');
60
+ info('[i] Usage: w2 run' + (argv.length ? ' ' + argv.join(' ') : ''));
61
61
  return process.exit(1);
62
62
  }
63
63
  var hash = options && options.storage && encodeURIComponent(options.storage);
@@ -94,58 +94,58 @@ program.setConfig({
94
94
 
95
95
  program
96
96
  .command('status')
97
- .description('Show the running status');
97
+ .description('Display running status');
98
98
  program
99
99
  .command('add')
100
- .description('Add rules from local js file (.whistle.js by default)');
100
+ .description('Add rules from local JS file (.whistle.js by default)');
101
101
  program.command('proxy')
102
- .description('Set global proxy');
102
+ .description('Configure system proxy settings');
103
103
  program.command('ca')
104
- .description('Install root CA');
104
+ .description('Manage Root CA certificates');
105
105
  program.command('install')
106
- .description('Install whistle plugin');
106
+ .description('Install Whistle plugin');
107
107
  program.command('uninstall')
108
- .description('Uninstall whistle plugin');
108
+ .description('Uninstall Whistle plugin');
109
109
  program.command('exec')
110
- .description('Exec whistle plugin cmd');
110
+ .description('Execute plugin command');
111
111
 
112
112
  program
113
- .option('-D, --baseDir [baseDir]', 'set the configured storage root path', String, undefined)
114
- .option('-z, --certDir [directory]', 'set custom certificate store directory', String, undefined)
115
- .option('-l, --localUIHost [hostname]', 'set the domain for the web ui (' + config.localUIHost + ' by default)', String, undefined)
116
- .option('-L, --pluginHost [hostname]', 'set the domain for the web ui of plugin (as: "script=a.b.com&vase=x.y.com")', String, undefined)
117
- .option('-n, --username [username]', 'set the username to access the web ui', String, undefined)
118
- .option('-w, --password [password]', 'set the password to access the web ui', String, undefined)
119
- .option('-N, --guestName [username]', 'set the the guest name to access the web ui (can only view the data)', String, undefined)
120
- .option('-W, --guestPassword [password]', 'set the guest password to access the web ui (can only view the data)', String, undefined)
121
- .option('-s, --sockets [number]', 'set the max number of cached connections on each domain (' + config.sockets + ' by default)', parseInt, undefined)
122
- .option('-S, --storage [newStorageDir]', 'set the configured storage directory', String, undefined)
123
- .option('-C, --copy [storageDir]', 'copy the configuration of the specified directory to a new directory', String, undefined)
124
- .option('-c, --dnsCache [time]', 'set the cache time of DNS (60000ms by default)', String, undefined)
125
- .option('-H, --host [boundHost]', 'set the bound host (INADDR_ANY by default)', String, undefined)
126
- .option('-p, --port [proxyPort]', 'set the proxy port (' + config.port + ' by default)', String, undefined)
127
- .option('-P, --uiport [uiport]', 'set the webui port', String, undefined)
128
- .option('-m, --middlewares [script path or module name]', 'set the express middlewares loaded at startup (as: xx,yy/zz.js)', String, undefined)
129
- .option('-M, --mode [mode]', 'set the starting mode (as: pureProxy|debug|multiEnv|capture|disableH2|network|rules|plugins|prod)', String, undefined)
130
- .option('-t, --timeout [ms]', 'set the request timeout (' + config.timeout + 'ms by default)', parseInt, undefined)
131
- .option('-e, --extra [extraData]', 'set the extra parameters for plugin', String, undefined)
132
- .option('-f, --secureFilter [secureFilter]', 'set the path of secure filter', String, undefined)
133
- .option('-r, --shadowRules [shadowRules]', 'set the shadow (default) rules', String, undefined)
134
- .option('-R, --reqCacheSize [reqCacheSize]', 'set the cache size of request data (600 by default)', String, undefined)
135
- .option('-F, --frameCacheSize [frameCacheSize]', 'set the cache size of webSocket and socket\'s frames (512 by default)', String, undefined)
113
+ .option('-D, --baseDir [baseDir]', 'set storage root path', String, undefined)
114
+ .option('-z, --certDir [directory]', 'set custom certificate directory', String, undefined)
115
+ .option('-l, --localUIHost [hostname]', 'set web UI domain (' + config.localUIHost + ' by default)', String, undefined)
116
+ .option('-L, --pluginHost [hostname]', 'set plugin UI domains (as: "script=a.b.com&vase=x.y.com")', String, undefined)
117
+ .option('-n, --username [username]', 'set web UI username', String, undefined)
118
+ .option('-w, --password [password]', 'set web UI password', String, undefined)
119
+ .option('-N, --guestName [username]', 'set web UI guest username (read-only)', String, undefined)
120
+ .option('-W, --guestPassword [password]', 'set web UI guest password (read-only)', String, undefined)
121
+ .option('-s, --sockets [number]', 'set max cached connections per domain (' + config.sockets + ' by default)', parseInt, undefined)
122
+ .option('-S, --storage [newStorageDir]', 'set configuration storage directory', String, undefined)
123
+ .option('-C, --copy [storageDir]', 'copy configuration from specified directory', String, undefined)
124
+ .option('-c, --dnsCache [time]', 'set DNS cache time (default: 60000ms)', String, undefined)
125
+ .option('-H, --host [boundHost]', 'set bound host (default: INADDR_ANY)', String, undefined)
126
+ .option('-p, --port [proxyPort]', 'set proxy port (default: ' + config.port + ' by default)', String, undefined)
127
+ .option('-P, --uiport [uiport]', 'set web UI port', String, undefined)
128
+ .option('-m, --middlewares [script path or module name]', 'set startup middlewares (format: xx,yy/zz.js)', String, undefined)
129
+ .option('-M, --mode [mode]', 'set startup mode (options: pureProxy|debug|multiEnv|capture|disableH2|network|rules|plugins|prod)', String, undefined)
130
+ .option('-t, --timeout [ms]', 'set request timeout (default: ' + config.timeout, parseInt, undefined)
131
+ .option('-e, --extra [extraData]', 'set plugin extra parameters', String, undefined)
132
+ .option('-f, --secureFilter [secureFilter]', 'set secure filter path', String, undefined)
133
+ .option('-r, --shadowRules [shadowRules]', 'set default shadow rules', String, undefined)
134
+ .option('-R, --reqCacheSize [reqCacheSize]', 'set request data cache size (default: 600)', String, undefined)
135
+ .option('-F, --frameCacheSize [frameCacheSize]', 'set WebSocket frame cache size (default: 512)', String, undefined)
136
136
  .option('-A, --addon [pluginPaths]', 'add custom plugin paths', String, undefined)
137
- .option('--init [bypass]', 'auto set global proxy (and bypass) and install root CA')
138
- .option('--cluster [workers]', 'start the cluster server and set worker number (os.cpus().length by default)', String, undefined)
139
- .option('--config [config]', 'load the startup config from a local file', String, undefined)
140
- .option('--dnsServer [dnsServer]', 'set custom dns servers', String, undefined)
141
- .option('--socksPort [socksPort]', 'set the socksv5 server port', String, undefined)
142
- .option('--httpPort [httpPort]', 'set the http server port', String, undefined)
143
- .option('--httpsPort [httpsPort]', 'set the https server port', String, undefined)
144
- .option('--allowOrigin [originList]', 'list of cross origin allowed to access webui (as: a.b.c,x.y.z or *)', String, undefined)
145
- .option('--no-global-plugins', 'do not load any globally installed plugins')
146
- .option('--no-prev-options', 'do not reuse the previous options when restarting')
147
- .option('--inspect [[host:]port]', 'activate inspector on host:port (127.0.0.1:9229 by default)')
148
- .option('--inspectBrk [[host:]port]', 'activate inspector on host:port and break at start of user script (127.0.0.1:9229 by default)');
137
+ .option('--init [bypass]', 'auto configure proxy and install Root CA')
138
+ .option('--cluster [workers]', 'start cluster with worker count (default: CPU cores)', String, undefined)
139
+ .option('--config [config]', 'load startup config from file', String, undefined)
140
+ .option('--dnsServer [dnsServer]', 'set custom DNS servers', String, undefined)
141
+ .option('--socksPort [socksPort]', 'set SOCKSv5 server port', String, undefined)
142
+ .option('--httpPort [httpPort]', 'set HTTP server port', String, undefined)
143
+ .option('--httpsPort [httpsPort]', 'set HTTPS server port', String, undefined)
144
+ .option('--allowOrigin [originList]', 'set allowed CORS origins (format: a.b.c,x.y.z or *)', String, undefined)
145
+ .option('--no-global-plugins', 'disable global plugins')
146
+ .option('--no-prev-options', 'ignore previous options on restart')
147
+ .option('--inspect [[host:]port]', 'enable inspector (default: 127.0.0.1:9229)')
148
+ .option('--inspectBrk [[host:]port]', 'enable inspector with breakpoint (default: 127.0.0.1:9229)');
149
149
 
150
150
  var argv = process.argv;
151
151
  var cmd = argv[2];
package/biz/index.js CHANGED
@@ -19,6 +19,7 @@ var CUSTOM_INTERNAL_APP = new RegExp('^/[\\w.-]*\\.whistle-path\\.5b6af7b9884e11
19
19
  var CUSTOM_PLUGIN_RE = new RegExp('^/[\\w.-]*\\.whistle-path\\.5b6af7b9884e1165[\\w.-]*/+whistle\\.([a-z\\d_-]+)/');
20
20
  var REAL_WEBUI_HOST_PARAM = /_whistleInternalHost_=(__([a-z\d.-]+)(?:__(\d{1,5}))?__)/;
21
21
  var OUTER_PLUGIN_RE = /^(?:\/whistle)?\/((?:whistle|plugin)\.[a-z\\d_-]+)::(\d{1,5})\//;
22
+ var SERVICE_HOST = 'admin.wiso.pro';
22
23
 
23
24
 
24
25
  function transformUI(req, res) {
@@ -28,6 +29,22 @@ function transformUI(req, res) {
28
29
  return handleUIReq(req, res);
29
30
  }
30
31
 
32
+ function setServiceUrl(req) {
33
+ var isService = req.path.indexOf('/whistle/service/') === 0;
34
+ if (isService || req.path.indexOf('/service/') === 0) {
35
+ if (isService) {
36
+ req.url = req.url.replace('/whistle/', '/');
37
+ }
38
+ req.headers.host = SERVICE_HOST;
39
+ req.headers[config.REAL_HOST_HEADER] = SERVICE_HOST;
40
+ req.isHttps = true;
41
+ req.isPluginReq = true;
42
+ req._isInternalReq = true;
43
+ req._isPureInternalReq = true;
44
+ return true;
45
+ }
46
+ }
47
+
31
48
  module.exports = function(req, res, next) {
32
49
  var config = this.config;
33
50
  var pluginMgr = this.pluginMgr;
@@ -122,6 +139,7 @@ module.exports = function(req, res, next) {
122
139
  isWebUI = true;
123
140
  }
124
141
  }
142
+ isWebUI = isWebUI && !setServiceUrl(req);
125
143
  // 后续有用到
126
144
  fullUrl = req.fullUrl = util.getFullUrl(req);
127
145
  if (bypass) {
@@ -1,10 +1,7 @@
1
1
  var config = require('../../../lib/config');
2
2
 
3
- var pid = process.pid;
4
-
5
- module.exports = function(req, res) {
3
+ module.exports = function(_, res) {
6
4
  res.json({
7
- pid: pid,
8
5
  storage: config.storage || '',
9
6
  client: config.client,
10
7
  whistleName: config.whistleName,
@@ -8,6 +8,6 @@
8
8
  </head>
9
9
  <body style="overscroll-behavior-x: none;">
10
10
  <div id="container" class="main"></div>
11
- <script src="js/index.js?v=2.9.97"></script>
11
+ <script src="js/index.js?v=2.9.98"></script>
12
12
  </body>
13
13
  </html>