fix: exit on EADDRINUSE instead of reusing port — prevents ghost instances with no tunnels
CI / Build & Test (push) Successful in 2m48s

Made-with: Cursor
This commit is contained in:
Raven Scott
2026-02-27 19:57:47 -05:00
parent b0b17e26df
commit 78e6af39f5
2 changed files with 4 additions and 10 deletions
+2 -5
View File
@@ -125,11 +125,8 @@ function start(port, upstreamPort, callback) {
server.on('error', (err) => {
if (err.code === 'EADDRINUSE') {
stderrLog('port ' + connectPort + ' already in use — previous instance still running, reusing port');
listenPort = connectPort;
server.removeAllListeners('error');
server.on('error', () => {});
done(null);
stderrLog('port ' + connectPort + ' already in use — another instance is running, exiting');
process.exit(0);
return;
}
stderrLog('server error:', err.message);