fix: exit on EADDRINUSE instead of reusing port — prevents ghost instances with no tunnels
CI / Build & Test (push) Successful in 2m48s
CI / Build & Test (push) Successful in 2m48s
Made-with: Cursor
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user