api: always create separate server for itunnels

This commit is contained in:
jj 2024-12-16 10:19:15 +00:00
parent e7c2872e40
commit f06aa65801
No known key found for this signature in database

View file

@ -316,8 +316,6 @@ export const runAPI = async (express, app, __dirname, isPrimary = true) => {
return stream(res, { type: 'internal', ...streamInfo }); return stream(res, { type: 'internal', ...streamInfo });
}; };
app.get('/itunnel', itunnelHandler);
app.get('/', (_, res) => { app.get('/', (_, res) => {
res.type('json'); res.type('json');
res.status(200).send(serverInfo); res.status(200).send(serverInfo);
@ -378,7 +376,6 @@ export const runAPI = async (express, app, __dirname, isPrimary = true) => {
} }
}); });
if (isCluster) {
const istreamer = express(); const istreamer = express();
istreamer.get('/itunnel', itunnelHandler); istreamer.get('/itunnel', itunnelHandler);
const server = istreamer.listen({ const server = istreamer.listen({
@ -391,4 +388,3 @@ export const runAPI = async (express, app, __dirname, isPrimary = true) => {
setTunnelPort(port); setTunnelPort(port);
}); });
} }
}