works locally again
This commit is contained in:
parent
a5a144364e
commit
dbb9483102
12
xip/xip.go
12
xip/xip.go
@ -369,6 +369,18 @@ func (xip *Xip) StartServer() {
|
|||||||
err := xip.server.ListenAndServe()
|
err := xip.server.ListenAndServe()
|
||||||
defer xip.server.Shutdown()
|
defer xip.server.Shutdown()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if strings.Contains(err.Error(), "fly-global-services: no such host") {
|
||||||
|
// we're not running on fly, bind to 0.0.0.0 instead
|
||||||
|
port := strings.Split(xip.server.Addr, ":")[1]
|
||||||
|
xip.server = dns.Server{
|
||||||
|
Addr: fmt.Sprintf(":%s", port),
|
||||||
|
Net: "udp",
|
||||||
|
}
|
||||||
|
|
||||||
|
xip.StartServer()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
log.Fatalf("Failed to start server: %s\n ", err.Error())
|
log.Fatalf("Failed to start server: %s\n ", err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user