@abtnode/router-provider 1.8.33 → 1.8.35
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/lib/nginx/index.js +7 -1
- package/lib/nginx/util.js +6 -2
- package/package.json +6 -6
package/lib/nginx/index.js
CHANGED
|
@@ -800,7 +800,13 @@ class NginxProvider extends BaseProvider {
|
|
|
800
800
|
validServices.forEach((service) => {
|
|
801
801
|
conf.nginx.stream._add('server');
|
|
802
802
|
const server = this._getLastStreamServer(conf);
|
|
803
|
-
|
|
803
|
+
let protocol = '';
|
|
804
|
+
if (service.protocol === 'udp') {
|
|
805
|
+
protocol = ` ${service.protocol}`;
|
|
806
|
+
server._add('proxy_responses', 1);
|
|
807
|
+
server._add('proxy_timeout', '1s');
|
|
808
|
+
}
|
|
809
|
+
|
|
804
810
|
server._add('listen', `${service.port}${protocol}`);
|
|
805
811
|
server._add('proxy_pass', `127.0.0.1:${service.upstreamPort}`);
|
|
806
812
|
});
|
package/lib/nginx/util.js
CHANGED
|
@@ -8,12 +8,14 @@ const { NginxConfFile } = require('nginx-conf');
|
|
|
8
8
|
const shelljs = require('shelljs');
|
|
9
9
|
const findProcess = require('find-process');
|
|
10
10
|
const moment = require('moment');
|
|
11
|
-
const { MAX_UPLOAD_FILE_SIZE } = require('@abtnode/constant');
|
|
11
|
+
const { MAX_UPLOAD_FILE_SIZE, MAX_NGINX_WORKER_CONNECTIONS } = require('@abtnode/constant');
|
|
12
12
|
const formatBackSlash = require('@abtnode/util/lib/format-back-slash');
|
|
13
13
|
|
|
14
14
|
const logger = require('@abtnode/logger')('router:nginx:util');
|
|
15
15
|
|
|
16
|
-
const MAX_WORKER_CONNECTIONS =
|
|
16
|
+
const MAX_WORKER_CONNECTIONS = process.env.MAX_NGINX_WORKER_CONNECTIONS
|
|
17
|
+
? Number(process.env.MAX_NGINX_WORKER_CONNECTIONS)
|
|
18
|
+
: MAX_NGINX_WORKER_CONNECTIONS;
|
|
17
19
|
const CLIENT_MAX_BODY_SIZE = process.env.MAX_UPLOAD_FILE_SIZE || MAX_UPLOAD_FILE_SIZE;
|
|
18
20
|
|
|
19
21
|
const formatError = (errStr) => {
|
|
@@ -69,6 +71,8 @@ const addTestServer = ({ configPath, port, upstreamPort }) =>
|
|
|
69
71
|
`
|
|
70
72
|
server {
|
|
71
73
|
listen ${upstreamPort} udp;
|
|
74
|
+
proxy_responses 1;
|
|
75
|
+
proxy_timeout 1s;
|
|
72
76
|
proxy_pass 127.0.0.1:${port};
|
|
73
77
|
}
|
|
74
78
|
`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abtnode/router-provider",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.35",
|
|
4
4
|
"description": "Routing engine implementations for abt node",
|
|
5
5
|
"author": "polunzh <polunzh@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/ArcBlock/blocklet-server#readme",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"url": "https://github.com/ArcBlock/blocklet-server/issues"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@abtnode/constant": "1.8.
|
|
36
|
-
"@abtnode/logger": "1.8.
|
|
37
|
-
"@abtnode/router-templates": "1.8.
|
|
38
|
-
"@abtnode/util": "1.8.
|
|
35
|
+
"@abtnode/constant": "1.8.35",
|
|
36
|
+
"@abtnode/logger": "1.8.35",
|
|
37
|
+
"@abtnode/router-templates": "1.8.35",
|
|
38
|
+
"@abtnode/util": "1.8.35",
|
|
39
39
|
"axios": "^0.27.2",
|
|
40
40
|
"debug": "^4.3.4",
|
|
41
41
|
"find-process": "^1.4.7",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"fs-extra": "^10.1.0",
|
|
63
63
|
"needle": "^3.1.0"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "dd89e7a61dc8cff64302608ad5ab6545dd903daa"
|
|
66
66
|
}
|