@@ -193,7 +193,7 @@ func (svc *Service) GetAccessibleURLs(includeLoopback bool) [][]string {
193
193
194
194
for _ , l := range svc .listenables {
195
195
s := l .serveable
196
- defaultVh := s . getDefaultVhost ()
196
+ s . updateDefaultVhost ()
197
197
198
198
port := ""
199
199
if ! isDefaultPort (l .port , s .useTLS ) {
@@ -219,34 +219,39 @@ func (svc *Service) GetAccessibleURLs(includeLoopback bool) [][]string {
219
219
vhUrls [vh ] = append (vhUrls [vh ], url )
220
220
}
221
221
}
222
- if vh == defaultVh {
223
- var url string
224
- if s .useTLS {
225
- url = httpsUrl
226
- } else {
227
- url = httpUrl
228
- }
229
- if len (l .ip ) > 0 {
230
- url = url + l .ip + port
231
- vhUrls [vh ] = append (vhUrls [vh ], url )
232
- } else {
233
- if ! gotIPList {
234
- gotIPList = true
235
- ipv46s , ipv4s , ipv6s = getAllIfaceIPs (includeLoopback )
236
- }
237
- var ips []string
238
- switch l .proto {
239
- case tcp46 :
240
- ips = ipv46s
241
- case tcp4 :
242
- ips = ipv4s
243
- case tcp6 :
244
- ips = ipv6s
245
- }
246
- for _ , ip := range ips {
247
- ipUrl := url + ip + port
248
- vhUrls [vh ] = append (vhUrls [vh ], ipUrl )
249
- }
222
+
223
+ if vh != s .defaultVhost {
224
+ continue
225
+ }
226
+ var url string
227
+ if s .useTLS {
228
+ url = httpsUrl
229
+ } else {
230
+ url = httpUrl
231
+ }
232
+ if len (l .ip ) > 0 {
233
+ url = url + l .ip + port
234
+ vhUrls [vh ] = append (vhUrls [vh ], url )
235
+ continue
236
+ }
237
+
238
+ if ! gotIPList {
239
+ gotIPList = true
240
+ ipv46s , ipv4s , ipv6s = getAllIfaceIPs (includeLoopback )
241
+ }
242
+ var ips []string
243
+ switch l .proto {
244
+ case tcp46 :
245
+ ips = ipv46s
246
+ case tcp4 :
247
+ ips = ipv4s
248
+ case tcp6 :
249
+ ips = ipv6s
250
+ }
251
+ for _ , ip := range ips {
252
+ if ipVh := s .lookupVhost (ip ); ipVh == vh {
253
+ ipUrl := url + ip + port
254
+ vhUrls [vh ] = append (vhUrls [vh ], ipUrl )
250
255
}
251
256
}
252
257
}
0 commit comments