api/core: fix main cluster being unable to handle itunnels

This commit is contained in:
jj 2024-11-02 09:59:48 +00:00
parent 676bc9879c
commit 382873dc11
No known key found for this signature in database

View file

@ -8,7 +8,7 @@ import jwt from "../security/jwt.js";
import stream from "../stream/stream.js"; import stream from "../stream/stream.js";
import match from "../processing/match.js"; import match from "../processing/match.js";
import { env, setTunnelPort } from "../config.js"; import { env, isCluster, setTunnelPort } from "../config.js";
import { extract } from "../processing/url.js"; import { extract } from "../processing/url.js";
import { Green, Bright, Cyan } from "../misc/console-text.js"; import { Green, Bright, Cyan } from "../misc/console-text.js";
import { hashHmac } from "../security/secrets.js"; import { hashHmac } from "../security/secrets.js";
@ -378,7 +378,7 @@ export const runAPI = async (express, app, __dirname, isPrimary = true) => {
} }
}); });
if (!isPrimary) { if (isCluster) {
const istreamer = express(); const istreamer = express();
istreamer.get('/itunnel', itunnelHandler); istreamer.get('/itunnel', itunnelHandler);
const server = istreamer.listen({ const server = istreamer.listen({