@certalis/agent-smith 0.1.10 → 0.1.12
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/dist/bin.js +1 -0
- package/dist/edge.js +5 -1
- package/dist/https.js +5 -1
- package/dist/pool.js +1 -0
- package/dist/server.js +1 -0
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -12358,6 +12358,7 @@ function startServer(options) {
|
|
|
12358
12358
|
if (options?.additionalUnixSocket) {
|
|
12359
12359
|
unixServerInstance = serve({
|
|
12360
12360
|
unix: options.additionalUnixSocket,
|
|
12361
|
+
idleTimeout: NETWORK.IDLE_TIMEOUT_MAX,
|
|
12361
12362
|
fetch: fetchHandler,
|
|
12362
12363
|
websocket: websocketProxyHandler
|
|
12363
12364
|
});
|
package/dist/edge.js
CHANGED
|
@@ -102,6 +102,7 @@ function createProxyEdgeHandler({
|
|
|
102
102
|
const path = req.method === "GET" && req.url === "/pool-health" ? "/health" : req.url ?? "";
|
|
103
103
|
const headers = selectHeaders(req.headers, REQUEST_HEADERS);
|
|
104
104
|
headers.host = "localhost";
|
|
105
|
+
headers.connection = "keep-alive";
|
|
105
106
|
headers["x-forwarded-for"] = "proxy-edge";
|
|
106
107
|
let upstreamResponse;
|
|
107
108
|
const upstream = request({ socketPath, path, method: req.method, headers, agent: false }, (response) => {
|
|
@@ -136,7 +137,10 @@ function createProxyEdgeHandler({
|
|
|
136
137
|
upstreamResponse?.destroy();
|
|
137
138
|
upstream.destroy();
|
|
138
139
|
});
|
|
139
|
-
upstream.once("error", () =>
|
|
140
|
+
upstream.once("error", (error) => {
|
|
141
|
+
console.error("Agent Smith private transport failed", error.code);
|
|
142
|
+
finish(502);
|
|
143
|
+
});
|
|
140
144
|
req.once("aborted", () => upstream.destroy());
|
|
141
145
|
req.once("error", () => upstream.destroy());
|
|
142
146
|
let bytes = 0;
|
package/dist/https.js
CHANGED
|
@@ -196,6 +196,7 @@ function createProxyEdgeHandler({
|
|
|
196
196
|
const path = req.method === "GET" && req.url === "/pool-health" ? "/health" : req.url ?? "";
|
|
197
197
|
const headers = selectHeaders(req.headers, REQUEST_HEADERS);
|
|
198
198
|
headers.host = "localhost";
|
|
199
|
+
headers.connection = "keep-alive";
|
|
199
200
|
headers["x-forwarded-for"] = "proxy-edge";
|
|
200
201
|
let upstreamResponse;
|
|
201
202
|
const upstream = request({ socketPath, path, method: req.method, headers, agent: false }, (response) => {
|
|
@@ -230,7 +231,10 @@ function createProxyEdgeHandler({
|
|
|
230
231
|
upstreamResponse?.destroy();
|
|
231
232
|
upstream.destroy();
|
|
232
233
|
});
|
|
233
|
-
upstream.once("error", () =>
|
|
234
|
+
upstream.once("error", (error) => {
|
|
235
|
+
console.error("Agent Smith private transport failed", error.code);
|
|
236
|
+
finish(502);
|
|
237
|
+
});
|
|
234
238
|
req.once("aborted", () => upstream.destroy());
|
|
235
239
|
req.once("error", () => upstream.destroy());
|
|
236
240
|
let bytes = 0;
|
package/dist/pool.js
CHANGED
|
@@ -12357,6 +12357,7 @@ function startServer(options) {
|
|
|
12357
12357
|
if (options?.additionalUnixSocket) {
|
|
12358
12358
|
unixServerInstance = serve({
|
|
12359
12359
|
unix: options.additionalUnixSocket,
|
|
12360
|
+
idleTimeout: NETWORK.IDLE_TIMEOUT_MAX,
|
|
12360
12361
|
fetch: fetchHandler,
|
|
12361
12362
|
websocket: websocketProxyHandler
|
|
12362
12363
|
});
|
package/dist/server.js
CHANGED
|
@@ -12357,6 +12357,7 @@ function startServer(options) {
|
|
|
12357
12357
|
if (options?.additionalUnixSocket) {
|
|
12358
12358
|
unixServerInstance = serve({
|
|
12359
12359
|
unix: options.additionalUnixSocket,
|
|
12360
|
+
idleTimeout: NETWORK.IDLE_TIMEOUT_MAX,
|
|
12360
12361
|
fetch: fetchHandler,
|
|
12361
12362
|
websocket: websocketProxyHandler
|
|
12362
12363
|
});
|
package/package.json
CHANGED