Skip to content

Commit ed3b1de

Browse files
committed
fix(core): port conflicts
1 parent 01620b1 commit ed3b1de

File tree

1 file changed

+1
-1
lines changed
  • packages/core/src/node

1 file changed

+1
-1
lines changed

packages/core/src/node/ws.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ const ANONYMOUS_SCOPE = 'vite:anonymous:'
2626

2727
export async function createWsServer(options: CreateWsServerOptions) {
2828
const rpcHost = options.context.rpc as unknown as RpcFunctionsHost
29-
const port = options.portWebSocket ?? await getPort({ port: 7812, random: true })!
3029
const host = options.hostWebSocket ?? 'localhost'
3130
const https = options.context.viteConfig.server.https
31+
const port = options.portWebSocket ?? await getPort({ port: 7812, host, random: true })!
3232

3333
const wsClients = new Set<WebSocket>()
3434

0 commit comments

Comments
 (0)