From 5add41cb31a36f5ce1b9db16ee4c616f422ef4fc Mon Sep 17 00:00:00 2001 From: ulises-jeremias Date: Tue, 17 Oct 2023 19:50:19 -0300 Subject: [PATCH] Rebuild --- plot/show.v | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plot/show.v b/plot/show.v index 3854e6016..9e3e84729 100644 --- a/plot/show.v +++ b/plot/show.v @@ -36,8 +36,10 @@ pub fn (plot Plot) show() ! { mut handler := PlotlyHandler{ plot: plot } + listener := net.listen_tcp(net.AddrFamily.ip, ':0')! mut server := &http.Server{ accept_timeout: 1 * time.second + listener: listener port: 0 handler: handler } @@ -46,7 +48,11 @@ pub fn (plot Plot) show() ! { for server.status() != .running { time.sleep(10 * time.millisecond) } - os.open_uri('http://${server.addr}')! + mut uri := 'http://${server.addr}' + for ip in ['0.0.0.0', '127.0.0.1'] { + uri = uri.replace(ip, 'localhost') + } + os.open_uri(uri)! t.wait() } }