File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -867,10 +867,8 @@ export async function resolveServerUrls(
867867
868868 if ( hostname . host && loopbackHosts . has ( hostname . host ) ) {
869869 let hostnameName = hostname . name
870- if (
871- hostnameName === '::1' ||
872- hostnameName === '0000:0000:0000:0000:0000:0000:0000:0001'
873- ) {
870+ // ipv6 host
871+ if ( hostnameName . includes ( ':' ) ) {
874872 hostnameName = `[${ hostnameName } ]`
875873 }
876874 local . push ( `${ protocol } ://${ hostnameName } :${ port } ${ base } ` )
@@ -886,7 +884,11 @@ export async function resolveServerUrls(
886884 ( typeof detail . family === 'number' && detail . family === 4 ) ) ,
887885 )
888886 . forEach ( ( detail ) => {
889- const host = detail . address . replace ( '127.0.0.1' , hostname . name )
887+ let host = detail . address . replace ( '127.0.0.1' , hostname . name )
888+ // ipv6 host
889+ if ( host . includes ( ':' ) ) {
890+ host = `[${ host } ]`
891+ }
890892 const url = `${ protocol } ://${ host } :${ port } ${ base } `
891893 if ( detail . address . includes ( '127.0.0.1' ) ) {
892894 local . push ( url )
You can’t perform that action at this time.
0 commit comments