diff --git a/cmd/sql-proxy-client/main.go b/cmd/sql-proxy-client/main.go index 989fbda..fe7a320 100644 --- a/cmd/sql-proxy-client/main.go +++ b/cmd/sql-proxy-client/main.go @@ -41,7 +41,13 @@ func main() { } func realMain() error { - host := flag.String("host", "127.0.0.1", "Local host to bind and listen for connections") + host := flag.String("host", func() string { + if h := os.Getenv("PLANETSCALE_LISTENING_HOST"); h != "" { + return h + } + return "127.0.0.1" + }(), "Local host to bind and listen for connections") + port := flag.String("port", "3306", "Local port to bind and listen for connections") remoteHost := flag.String("remote-host", "", "MySQL remote host")