yakuza0 2.20.9 → 2.20.10
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/package.json +2 -2
- package/server/proxy/web.js +21 -2
- package/utils/inclusive.js +3 -1
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yakuza0",
|
|
3
|
-
"version": "2.20.
|
|
3
|
+
"version": "2.20.10",
|
|
4
4
|
"description": "yakuza0 with nuxt",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "babel --no-babelrc src -d . --presets=env --plugins=transform-runtime,transform-object-rest-spread,add-module-exports",
|
|
8
|
-
"pub:beta": "npm run build && npm version prerelease --preid=beta &&
|
|
8
|
+
"pub:beta": "npm run build && npm version prerelease --preid=beta && pxnpm publish --tag beta",
|
|
9
9
|
"pub": "npm run build && npm version patch && npm publish",
|
|
10
10
|
"postinstall": "yk verify commit-init",
|
|
11
11
|
"test": "jest"
|
package/server/proxy/web.js
CHANGED
|
@@ -4,6 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
+
var _keys = require('babel-runtime/core-js/object/keys');
|
|
8
|
+
|
|
9
|
+
var _keys2 = _interopRequireDefault(_keys);
|
|
10
|
+
|
|
7
11
|
var _regenerator = require('babel-runtime/regenerator');
|
|
8
12
|
|
|
9
13
|
var _regenerator2 = _interopRequireDefault(_regenerator);
|
|
@@ -101,7 +105,7 @@ exports.default = function () {
|
|
|
101
105
|
proxyConf = _ref.proxyConf,
|
|
102
106
|
nuxt = _ref.nuxt,
|
|
103
107
|
config = _ref.config;
|
|
104
|
-
var pKey, servers;
|
|
108
|
+
var pKey, servers, wsProxyKeys;
|
|
105
109
|
return _regenerator2.default.wrap(function _callee3$(_context3) {
|
|
106
110
|
while (1) {
|
|
107
111
|
switch (_context3.prev = _context3.next) {
|
|
@@ -323,6 +327,8 @@ exports.default = function () {
|
|
|
323
327
|
}, getCert()), app.callback()).listen(config.appConf.appPort));
|
|
324
328
|
}
|
|
325
329
|
|
|
330
|
+
wsProxyKeys = (0, _keys2.default)(_config2.default.proxyServer.ws.proxy);
|
|
331
|
+
|
|
326
332
|
servers.forEach(function (ser) {
|
|
327
333
|
ser.on('upgrade', function (req, socket, head) {
|
|
328
334
|
if (_config2.default.server.om.enabled && _server.global.__cpm__ && (0, _om.isOmOpen)(req)) {
|
|
@@ -349,13 +355,26 @@ exports.default = function () {
|
|
|
349
355
|
headers: headers
|
|
350
356
|
}, defProxyOpt));
|
|
351
357
|
}
|
|
358
|
+
|
|
359
|
+
var wsProxyKey = '';
|
|
360
|
+
wsProxyKeys.forEach(function (key) {
|
|
361
|
+
if (req.url.indexOf(key) !== -1) {
|
|
362
|
+
wsProxyKey = key;
|
|
363
|
+
}
|
|
364
|
+
});
|
|
365
|
+
if (wsProxyKey && wsProxyKey.startsWith(_config2.default.proxyServer.ws.prefix)) {
|
|
366
|
+
req.url = req.url.replace('/' + wsProxyKey, '');
|
|
367
|
+
_mid.proxy.ws(req, socket, head, (0, _extends3.default)({
|
|
368
|
+
target: _config2.default.proxyServer.ws.proxy[wsProxyKey]
|
|
369
|
+
}, defProxyOpt));
|
|
370
|
+
}
|
|
352
371
|
}
|
|
353
372
|
|
|
354
373
|
socket.on('error', function (err) {});
|
|
355
374
|
});
|
|
356
375
|
});
|
|
357
376
|
|
|
358
|
-
case
|
|
377
|
+
case 8:
|
|
359
378
|
case 'end':
|
|
360
379
|
return _context3.stop();
|
|
361
380
|
}
|
package/utils/inclusive.js
CHANGED