Skip to content

Commit 7632247

Browse files
authoredJun 17, 2022
fix(server): skip localhost verbatim dns lookup (#8642)
1 parent f520a54 commit 7632247

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed
 

‎packages/vite/src/node/http.ts

-8
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import type {
55
OutgoingHttpHeaders as HttpServerHeaders
66
} from 'http'
77
import type { ServerOptions as HttpsServerOptions } from 'https'
8-
import { promises as dns } from 'dns'
98
import type { Connect } from 'types/connect'
109
import { isObject } from './utils'
1110
import type { ProxyOptions } from './server/middlewares/proxy'
@@ -187,13 +186,6 @@ export async function httpServerStart(
187186
): Promise<number> {
188187
let { port, strictPort, host, logger } = serverOptions
189188

190-
// This could be removed when Vite only supports Node 17+ because verbatim=true is default
191-
// https://github.com/nodejs/node/pull/39987
192-
if (host === 'localhost') {
193-
const addr = await dns.lookup('localhost', { verbatim: true })
194-
host = addr.address
195-
}
196-
197189
return new Promise((resolve, reject) => {
198190
const onError = (e: Error & { code?: string }) => {
199191
if (e.code === 'EADDRINUSE') {

0 commit comments

Comments
 (0)
Please sign in to comment.