Skip to content

Commit ba14811

Browse files
committed
Disable Node's new autoSelectFamily behaviour for now
1 parent 926d65c commit ba14811

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/commands/start.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ const envToken = process.env.HTK_SERVER_TOKEN;
88
delete process.env.HTK_SERVER_TOKEN; // Don't let anything else see this
99

1010
import * as path from 'path';
11-
import { promises as fs } from 'fs'
11+
import { promises as fs } from 'fs';
12+
import * as net from 'net';
1213
import * as semver from 'semver';
1314

1415
import { IS_PROD_BUILD } from '../constants';
@@ -43,8 +44,10 @@ class HttpToolkitServer extends Command {
4344
async run() {
4445
const { flags } = this.parse(HttpToolkitServer);
4546

47+
if (net.setDefaultAutoSelectFamily) { // Backward compat for Node <v20
48+
net.setDefaultAutoSelectFamily(false); // Disable this for now - new in Node v20 and seems unstable
49+
}
4650
this.setProcessTitle();
47-
4851
this.cleanupOldServers(); // Async cleanup old server versions
4952

5053
await runHTK({

0 commit comments

Comments
 (0)