cloudcms-server 0.9.270 → 0.9.271
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/middleware/proxy/proxy.js +5 -9
- package/package.json +2 -2
- package/temp/http-proxy/.auto-changelog +6 -0
- package/temp/http-proxy/.gitattributes +1 -0
- package/temp/http-proxy/CHANGELOG.md +1872 -0
- package/temp/http-proxy/CODE_OF_CONDUCT.md +74 -0
- package/temp/http-proxy/LICENSE +23 -0
- package/temp/http-proxy/README.md +568 -0
- package/temp/http-proxy/codecov.yml +10 -0
- package/temp/http-proxy/index.js +13 -0
- package/temp/http-proxy/lib/http-proxy/common.js +220 -0
- package/temp/http-proxy/lib/http-proxy/index.js +174 -0
- package/temp/http-proxy/lib/http-proxy/passes/web-incoming.js +174 -0
- package/temp/http-proxy/lib/http-proxy/passes/web-outgoing.js +135 -0
- package/temp/http-proxy/lib/http-proxy/passes/ws-incoming.js +141 -0
- package/temp/http-proxy/lib/index.js +13 -0
- package/temp/http-proxy/package.json +41 -0
- package/temp/http-proxy/renovate.json +19 -0
- package/temp/node-http-proxy/.eslintignore +3 -0
- package/temp/node-http-proxy/.eslintrc.js +21 -0
- package/temp/node-http-proxy/.github/workflows/ci.yml +30 -0
- package/temp/node-http-proxy/.prettierrc +7 -0
- package/temp/node-http-proxy/CODE_OF_CONDUCT.md +74 -0
- package/temp/node-http-proxy/LICENSE +23 -0
- package/temp/node-http-proxy/README.md +568 -0
- package/temp/node-http-proxy/codecov.yml +10 -0
- package/temp/node-http-proxy/dist/http-proxy/common.js +220 -0
- package/temp/node-http-proxy/dist/http-proxy/index.js +174 -0
- package/temp/node-http-proxy/dist/http-proxy/passes/web-incoming.js +174 -0
- package/temp/node-http-proxy/dist/http-proxy/passes/web-outgoing.js +135 -0
- package/temp/node-http-proxy/dist/http-proxy/passes/ws-incoming.js +141 -0
- package/temp/node-http-proxy/dist/index.js +13 -0
- package/temp/node-http-proxy/lib/http-proxy/common.js +265 -0
- package/temp/node-http-proxy/lib/http-proxy/index.ts +242 -0
- package/temp/node-http-proxy/lib/http-proxy/passes/web-incoming.js +208 -0
- package/temp/node-http-proxy/lib/http-proxy/passes/web-outgoing.js +163 -0
- package/temp/node-http-proxy/lib/http-proxy/passes/ws-incoming.js +179 -0
- package/temp/node-http-proxy/lib/index.ts +13 -0
- package/temp/node-http-proxy/lib/types.d.ts +277 -0
- package/temp/node-http-proxy/package-lock.json +5028 -0
- package/temp/node-http-proxy/package.json +47 -0
- package/temp/node-http-proxy/tsconfig.build.json +4 -0
- package/temp/node-http-proxy/tsconfig.json +115 -0
- package/temp/node-http-proxy/vitest.config.ts +9 -0
- package/util/proxy-factory.js +39 -128
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const url = require('url'), common = require('../common');
|
|
3
|
+
const redirectRegex = /^201|30(1|2|7|8)$/;
|
|
4
|
+
/*!
|
|
5
|
+
* Array of passes.
|
|
6
|
+
*
|
|
7
|
+
* A `pass` is just a function that is executed on `req, res, options`
|
|
8
|
+
* so that you can easily add new checks while still keeping the base
|
|
9
|
+
* flexible.
|
|
10
|
+
*/
|
|
11
|
+
module.exports = {
|
|
12
|
+
// <--
|
|
13
|
+
/**
|
|
14
|
+
* If is a HTTP 1.0 request, remove chunk headers
|
|
15
|
+
*
|
|
16
|
+
* @param {ClientRequest} req Request object
|
|
17
|
+
* @param {IncomingMessage} res Response object
|
|
18
|
+
* @param {proxyResponse} proxyRes Response object from the proxy request
|
|
19
|
+
*
|
|
20
|
+
* @api private
|
|
21
|
+
*/
|
|
22
|
+
removeChunked: function removeChunked(req, res, proxyRes) {
|
|
23
|
+
if (req.httpVersion === '1.0') {
|
|
24
|
+
delete proxyRes.headers['transfer-encoding'];
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
/**
|
|
28
|
+
* If is a HTTP 1.0 request, set the correct connection header
|
|
29
|
+
* or if connection header not present, then use `keep-alive`
|
|
30
|
+
*
|
|
31
|
+
* @param {ClientRequest} req Request object
|
|
32
|
+
* @param {IncomingMessage} res Response object
|
|
33
|
+
* @param {proxyResponse} proxyRes Response object from the proxy request
|
|
34
|
+
*
|
|
35
|
+
* @api private
|
|
36
|
+
*/
|
|
37
|
+
setConnection: function setConnection(req, res, proxyRes) {
|
|
38
|
+
if (req.httpVersion === '1.0') {
|
|
39
|
+
proxyRes.headers.connection = req.headers.connection || 'close';
|
|
40
|
+
}
|
|
41
|
+
else if (req.httpVersion !== '2.0' && !proxyRes.headers.connection) {
|
|
42
|
+
proxyRes.headers.connection = req.headers.connection || 'keep-alive';
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
setRedirectHostRewrite: function setRedirectHostRewrite(req, res, proxyRes, options) {
|
|
46
|
+
if ((options.hostRewrite || options.autoRewrite || options.protocolRewrite) &&
|
|
47
|
+
proxyRes.headers['location'] &&
|
|
48
|
+
redirectRegex.test(proxyRes.statusCode)) {
|
|
49
|
+
const target = url.parse(options.target);
|
|
50
|
+
const u = url.parse(proxyRes.headers['location']);
|
|
51
|
+
// make sure the redirected host matches the target host before rewriting
|
|
52
|
+
if (target.host != u.host) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (options.hostRewrite) {
|
|
56
|
+
u.host = options.hostRewrite;
|
|
57
|
+
}
|
|
58
|
+
else if (options.autoRewrite) {
|
|
59
|
+
u.host = req.headers['host'];
|
|
60
|
+
}
|
|
61
|
+
if (options.protocolRewrite) {
|
|
62
|
+
u.protocol = options.protocolRewrite;
|
|
63
|
+
}
|
|
64
|
+
proxyRes.headers['location'] = u.format();
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
/**
|
|
68
|
+
* Copy headers from proxyResponse to response
|
|
69
|
+
* set each header in response object.
|
|
70
|
+
*
|
|
71
|
+
* @param {ClientRequest} req Request object
|
|
72
|
+
* @param {IncomingMessage} res Response object
|
|
73
|
+
* @param {proxyResponse} proxyRes Response object from the proxy request
|
|
74
|
+
* @param {Object} options options.cookieDomainRewrite: Config to rewrite cookie domain
|
|
75
|
+
*
|
|
76
|
+
* @api private
|
|
77
|
+
*/
|
|
78
|
+
writeHeaders: function writeHeaders(req, res, proxyRes, options) {
|
|
79
|
+
let rewriteCookieDomainConfig = options.cookieDomainRewrite, rewriteCookiePathConfig = options.cookiePathRewrite, rawHeaderKeyMap;
|
|
80
|
+
const preserveHeaderKeyCase = options.preserveHeaderKeyCase, setHeader = function (key, header) {
|
|
81
|
+
if (header == undefined)
|
|
82
|
+
return;
|
|
83
|
+
if (rewriteCookieDomainConfig && key.toLowerCase() === 'set-cookie') {
|
|
84
|
+
header = common.rewriteCookieProperty(header, rewriteCookieDomainConfig, 'domain');
|
|
85
|
+
}
|
|
86
|
+
if (rewriteCookiePathConfig && key.toLowerCase() === 'set-cookie') {
|
|
87
|
+
header = common.rewriteCookieProperty(header, rewriteCookiePathConfig, 'path');
|
|
88
|
+
}
|
|
89
|
+
res.setHeader(String(key).trim(), header);
|
|
90
|
+
};
|
|
91
|
+
if (typeof rewriteCookieDomainConfig === 'string') {
|
|
92
|
+
//also test for ''
|
|
93
|
+
rewriteCookieDomainConfig = { '*': rewriteCookieDomainConfig };
|
|
94
|
+
}
|
|
95
|
+
if (typeof rewriteCookiePathConfig === 'string') {
|
|
96
|
+
//also test for ''
|
|
97
|
+
rewriteCookiePathConfig = { '*': rewriteCookiePathConfig };
|
|
98
|
+
}
|
|
99
|
+
// message.rawHeaders is added in: v0.11.6
|
|
100
|
+
// https://nodejs.org/api/http.html#http_message_rawheaders
|
|
101
|
+
if (preserveHeaderKeyCase && proxyRes.rawHeaders != undefined) {
|
|
102
|
+
rawHeaderKeyMap = {};
|
|
103
|
+
for (let i = 0; i < proxyRes.rawHeaders.length; i += 2) {
|
|
104
|
+
const key = proxyRes.rawHeaders[i];
|
|
105
|
+
rawHeaderKeyMap[key.toLowerCase()] = key;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
Object.keys(proxyRes.headers).forEach(function (key) {
|
|
109
|
+
const header = proxyRes.headers[key];
|
|
110
|
+
if (preserveHeaderKeyCase && rawHeaderKeyMap) {
|
|
111
|
+
key = rawHeaderKeyMap[key] || key;
|
|
112
|
+
}
|
|
113
|
+
setHeader(key, header);
|
|
114
|
+
});
|
|
115
|
+
},
|
|
116
|
+
/**
|
|
117
|
+
* Set the statusCode from the proxyResponse
|
|
118
|
+
*
|
|
119
|
+
* @param {ClientRequest} req Request object
|
|
120
|
+
* @param {IncomingMessage} res Response object
|
|
121
|
+
* @param {proxyResponse} proxyRes Response object from the proxy request
|
|
122
|
+
*
|
|
123
|
+
* @api private
|
|
124
|
+
*/
|
|
125
|
+
writeStatusCode: function writeStatusCode(req, res, proxyRes) {
|
|
126
|
+
// From Node.js docs: response.writeHead(statusCode[, statusMessage][, headers])
|
|
127
|
+
if (proxyRes.statusMessage) {
|
|
128
|
+
res.statusCode = proxyRes.statusCode;
|
|
129
|
+
res.statusMessage = proxyRes.statusMessage;
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
res.statusCode = proxyRes.statusCode;
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const http = require('http'), https = require('https'), common = require('../common');
|
|
3
|
+
/*!
|
|
4
|
+
* Array of passes.
|
|
5
|
+
*
|
|
6
|
+
* A `pass` is just a function that is executed on `req, socket, options`
|
|
7
|
+
* so that you can easily add new checks while still keeping the base
|
|
8
|
+
* flexible.
|
|
9
|
+
*/
|
|
10
|
+
/*
|
|
11
|
+
* Websockets Passes
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
module.exports = {
|
|
15
|
+
/**
|
|
16
|
+
* WebSocket requests must have the `GET` method and
|
|
17
|
+
* the `upgrade:websocket` header
|
|
18
|
+
*
|
|
19
|
+
* @param {ClientRequest} req Request object
|
|
20
|
+
* @param {Socket} socket
|
|
21
|
+
*
|
|
22
|
+
* @api private
|
|
23
|
+
*/
|
|
24
|
+
checkMethodAndHeader: function checkMethodAndHeader(req, socket) {
|
|
25
|
+
if (req.method !== 'GET' || !req.headers.upgrade) {
|
|
26
|
+
socket.destroy();
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
if (req.headers.upgrade.toLowerCase() !== 'websocket') {
|
|
30
|
+
socket.destroy();
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
/**
|
|
35
|
+
* Sets `x-forwarded-*` headers if specified in config.
|
|
36
|
+
*
|
|
37
|
+
* @param {ClientRequest} req Request object
|
|
38
|
+
* @param {Socket} socket
|
|
39
|
+
* @param {Object} options Config object passed to the proxy
|
|
40
|
+
*
|
|
41
|
+
* @api private
|
|
42
|
+
*/
|
|
43
|
+
XHeaders: function XHeaders(req, socket, options) {
|
|
44
|
+
if (!options.xfwd)
|
|
45
|
+
return;
|
|
46
|
+
const values = {
|
|
47
|
+
for: req.connection.remoteAddress || req.socket.remoteAddress,
|
|
48
|
+
port: common.getPort(req),
|
|
49
|
+
proto: common.hasEncryptedConnection(req) ? 'wss' : 'ws',
|
|
50
|
+
};
|
|
51
|
+
['for', 'port', 'proto'].forEach(function (header) {
|
|
52
|
+
req.headers['x-forwarded-' + header] =
|
|
53
|
+
(req.headers['x-forwarded-' + header] || '') +
|
|
54
|
+
(req.headers['x-forwarded-' + header] ? ',' : '') +
|
|
55
|
+
values[header];
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
/**
|
|
59
|
+
* Does the actual proxying. Make the request and upgrade it
|
|
60
|
+
* send the Switching Protocols request and pipe the sockets.
|
|
61
|
+
*
|
|
62
|
+
* @param {ClientRequest} req Request object
|
|
63
|
+
* @param {Socket} socket
|
|
64
|
+
* @param {Object} options Config object passed to the proxy
|
|
65
|
+
*
|
|
66
|
+
* @api private
|
|
67
|
+
*/
|
|
68
|
+
stream: function stream(req, socket, options, head, server, clb) {
|
|
69
|
+
const createHttpHeader = function (line, headers) {
|
|
70
|
+
return (Object.keys(headers)
|
|
71
|
+
.reduce(function (head, key) {
|
|
72
|
+
const value = headers[key];
|
|
73
|
+
if (!Array.isArray(value)) {
|
|
74
|
+
head.push(key + ': ' + value);
|
|
75
|
+
return head;
|
|
76
|
+
}
|
|
77
|
+
for (let i = 0; i < value.length; i++) {
|
|
78
|
+
head.push(key + ': ' + value[i]);
|
|
79
|
+
}
|
|
80
|
+
return head;
|
|
81
|
+
}, [line])
|
|
82
|
+
.join('\r\n') + '\r\n\r\n');
|
|
83
|
+
};
|
|
84
|
+
common.setupSocket(socket);
|
|
85
|
+
if (head && head.length)
|
|
86
|
+
socket.unshift(head);
|
|
87
|
+
const proxyReq = (common.isSSL.test(options.target.protocol) ? https : http).request(common.setupOutgoing(options.ssl || {}, options, req));
|
|
88
|
+
// Enable developers to modify the proxyReq before headers are sent
|
|
89
|
+
if (server) {
|
|
90
|
+
server.emit('proxyReqWs', proxyReq, req, socket, options, head);
|
|
91
|
+
}
|
|
92
|
+
// Error Handler
|
|
93
|
+
proxyReq.on('error', onOutgoingError);
|
|
94
|
+
proxyReq.on('response', function (res) {
|
|
95
|
+
// if upgrade event isn't going to happen, close the socket
|
|
96
|
+
if (!res.upgrade) {
|
|
97
|
+
socket.write(createHttpHeader('HTTP/' +
|
|
98
|
+
res.httpVersion +
|
|
99
|
+
' ' +
|
|
100
|
+
res.statusCode +
|
|
101
|
+
' ' +
|
|
102
|
+
res.statusMessage, res.headers));
|
|
103
|
+
res.pipe(socket);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
proxyReq.on('upgrade', function (proxyRes, proxySocket, proxyHead) {
|
|
107
|
+
proxySocket.on('error', onOutgoingError);
|
|
108
|
+
// Allow us to listen when the websocket has completed
|
|
109
|
+
proxySocket.on('end', function () {
|
|
110
|
+
server.emit('close', proxyRes, proxySocket, proxyHead);
|
|
111
|
+
});
|
|
112
|
+
// The pipe below will end proxySocket if socket closes cleanly, but not
|
|
113
|
+
// if it errors (eg, vanishes from the net and starts returning
|
|
114
|
+
// EHOSTUNREACH). We need to do that explicitly.
|
|
115
|
+
socket.on('error', function () {
|
|
116
|
+
proxySocket.end();
|
|
117
|
+
});
|
|
118
|
+
common.setupSocket(proxySocket);
|
|
119
|
+
if (proxyHead && proxyHead.length)
|
|
120
|
+
proxySocket.unshift(proxyHead);
|
|
121
|
+
//
|
|
122
|
+
// Remark: Handle writing the headers to the socket when switching protocols
|
|
123
|
+
// Also handles when a header is an array
|
|
124
|
+
//
|
|
125
|
+
socket.write(createHttpHeader('HTTP/1.1 101 Switching Protocols', proxyRes.headers));
|
|
126
|
+
proxySocket.pipe(socket).pipe(proxySocket);
|
|
127
|
+
server.emit('open', proxySocket);
|
|
128
|
+
server.emit('proxySocket', proxySocket); //DEPRECATED.
|
|
129
|
+
});
|
|
130
|
+
return proxyReq.end(); // XXX: CHECK IF THIS IS THIS CORRECT
|
|
131
|
+
function onOutgoingError(err) {
|
|
132
|
+
if (clb) {
|
|
133
|
+
clb(err, req, socket);
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
server.emit('error', err, req, socket);
|
|
137
|
+
}
|
|
138
|
+
socket.end();
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Caron dimonio, con occhi di bragia
|
|
4
|
+
* loro accennando, tutte le raccoglie;
|
|
5
|
+
* batte col remo qualunque s’adagia
|
|
6
|
+
*
|
|
7
|
+
* Charon the demon, with the eyes of glede,
|
|
8
|
+
* Beckoning to them, collects them all together,
|
|
9
|
+
* Beats with his oar whoever lags behind
|
|
10
|
+
*
|
|
11
|
+
* Dante - The Divine Comedy (Canto III)
|
|
12
|
+
*/
|
|
13
|
+
module.exports = './http-proxy';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "http-proxy",
|
|
3
|
+
"version": "1.18.1",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/http-party/node-http-proxy.git"
|
|
7
|
+
},
|
|
8
|
+
"description": "HTTP proxying for the masses",
|
|
9
|
+
"author": "Charlie Robbins <charlie.robbins@gmail.com>",
|
|
10
|
+
"maintainers": [
|
|
11
|
+
"jcrugzz <jcrugzz@gmail.com>"
|
|
12
|
+
],
|
|
13
|
+
"main": "index.js",
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"eventemitter3": "^4.0.0",
|
|
16
|
+
"requires-port": "^1.0.0",
|
|
17
|
+
"follow-redirects": "^1.0.0"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"async": "^3.0.0",
|
|
21
|
+
"auto-changelog": "^1.15.0",
|
|
22
|
+
"concat-stream": "^2.0.0",
|
|
23
|
+
"expect.js": "~0.3.1",
|
|
24
|
+
"mocha": "^3.5.3",
|
|
25
|
+
"nyc": "^14.0.0",
|
|
26
|
+
"semver": "^5.0.3",
|
|
27
|
+
"socket.io": "^2.1.0",
|
|
28
|
+
"socket.io-client": "^2.1.0",
|
|
29
|
+
"sse": "0.0.8",
|
|
30
|
+
"ws": "^3.0.0"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"mocha": "mocha test/*-test.js",
|
|
34
|
+
"test": "nyc --reporter=text --reporter=lcov npm run mocha",
|
|
35
|
+
"version": "auto-changelog -p && git add CHANGELOG.md"
|
|
36
|
+
},
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=8.0.0"
|
|
39
|
+
},
|
|
40
|
+
"license": "MIT"
|
|
41
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"platform": "github",
|
|
3
|
+
"autodiscover": false,
|
|
4
|
+
"requireConfig": true,
|
|
5
|
+
"ignoreNpmrcFile": true,
|
|
6
|
+
"rangeStrategy": "replace",
|
|
7
|
+
"packageRules": [
|
|
8
|
+
{
|
|
9
|
+
"packagePatterns": [
|
|
10
|
+
"*"
|
|
11
|
+
],
|
|
12
|
+
"minor": {
|
|
13
|
+
"groupName": "all non-major dependencies",
|
|
14
|
+
"groupSlug": "all-minor-patch"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"commitMessagePrefix": "[dist]"
|
|
19
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
root: true,
|
|
3
|
+
parser: '@typescript-eslint/parser',
|
|
4
|
+
parserOptions: {
|
|
5
|
+
project: './tsconfig.json',
|
|
6
|
+
},
|
|
7
|
+
plugins: ['@typescript-eslint'],
|
|
8
|
+
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
|
|
9
|
+
env: {
|
|
10
|
+
node: true,
|
|
11
|
+
es2016: true,
|
|
12
|
+
// Not using jest, but the test globals are jest-like so this works.
|
|
13
|
+
jest: true,
|
|
14
|
+
},
|
|
15
|
+
rules: {
|
|
16
|
+
'@typescript-eslint/ban-ts-comment': ['off'],
|
|
17
|
+
'@typescript-eslint/no-empty-function': ['off'],
|
|
18
|
+
'no-var': ['error'],
|
|
19
|
+
'prefer-const': ['error'],
|
|
20
|
+
},
|
|
21
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
|
|
2
|
+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
|
3
|
+
|
|
4
|
+
name: CI
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches: [ "master" ]
|
|
9
|
+
pull_request:
|
|
10
|
+
branches: [ "master" ]
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build:
|
|
14
|
+
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
|
|
17
|
+
strategy:
|
|
18
|
+
matrix:
|
|
19
|
+
node-version: [14.x, 16.x, 18.x]
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v3
|
|
23
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
24
|
+
uses: actions/setup-node@v3
|
|
25
|
+
with:
|
|
26
|
+
node-version: ${{ matrix.node-version }}
|
|
27
|
+
cache: 'npm'
|
|
28
|
+
- run: npm ci
|
|
29
|
+
- run: npm run build
|
|
30
|
+
- run: npm run test
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
|
10
|
+
orientation.
|
|
11
|
+
|
|
12
|
+
## Our Standards
|
|
13
|
+
|
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
|
15
|
+
include:
|
|
16
|
+
|
|
17
|
+
* Using welcoming and inclusive language
|
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
|
19
|
+
* Gracefully accepting constructive criticism
|
|
20
|
+
* Focusing on what is best for the community
|
|
21
|
+
* Showing empathy towards other community members
|
|
22
|
+
|
|
23
|
+
Examples of unacceptable behavior by participants include:
|
|
24
|
+
|
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
|
26
|
+
advances
|
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
|
28
|
+
* Public or private harassment
|
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
|
30
|
+
address, without explicit permission
|
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
32
|
+
professional setting
|
|
33
|
+
|
|
34
|
+
## Our Responsibilities
|
|
35
|
+
|
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
|
38
|
+
response to any instances of unacceptable behavior.
|
|
39
|
+
|
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
|
44
|
+
threatening, offensive, or harmful.
|
|
45
|
+
|
|
46
|
+
## Scope
|
|
47
|
+
|
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
|
49
|
+
when an individual is representing the project or its community. Examples of
|
|
50
|
+
representing a project or community include using an official project e-mail
|
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
|
53
|
+
further defined and clarified by project maintainers.
|
|
54
|
+
|
|
55
|
+
## Enforcement
|
|
56
|
+
|
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
58
|
+
reported by contacting the project team at <https://github.com/http-party/node-http-proxy>. All
|
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
|
63
|
+
|
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
|
66
|
+
members of the project's leadership.
|
|
67
|
+
|
|
68
|
+
## Attribution
|
|
69
|
+
|
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
|
72
|
+
|
|
73
|
+
[homepage]: http://contributor-covenant.org
|
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
node-http-proxy
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2010-2016 Charlie Robbins, Jarrett Cruger & the Contributors.
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
7
|
+
a copy of this software and associated documentation files (the
|
|
8
|
+
"Software"), to deal in the Software without restriction, including
|
|
9
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
10
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
11
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
12
|
+
the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be
|
|
15
|
+
included in all copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
18
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
19
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
20
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
21
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
22
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
23
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|