@lobb-js/core 0.15.0 → 0.15.1
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 +1 -1
- package/src/api/WebServer.ts +9 -1
package/package.json
CHANGED
package/src/api/WebServer.ts
CHANGED
|
@@ -77,7 +77,15 @@ export class WebServer {
|
|
|
77
77
|
this.server = Bun.serve({
|
|
78
78
|
port: this.webConfig.port ?? 3000,
|
|
79
79
|
hostname: this.webConfig.host ?? "0.0.0.0",
|
|
80
|
-
fetch:
|
|
80
|
+
fetch: (req, server) => {
|
|
81
|
+
// Bun closes idle connections after 10s by default.
|
|
82
|
+
// SSE connections (/api/events) are long-lived and may have quiet periods,
|
|
83
|
+
// so we disable the timeout per-request only for that route.
|
|
84
|
+
if (new URL(req.url).pathname.startsWith("/api/events")) {
|
|
85
|
+
server.timeout(req, 0);
|
|
86
|
+
}
|
|
87
|
+
return this.app.fetch(req);
|
|
88
|
+
},
|
|
81
89
|
});
|
|
82
90
|
this.port = this.server.port!;
|
|
83
91
|
}
|