From 7941f00c355f9f4eeb75724b3ef1c283656ab773 Mon Sep 17 00:00:00 2001 From: Atterpac <89053530+atterpac@users.noreply.github.com> Date: Mon, 29 Jul 2024 03:46:44 -0700 Subject: [PATCH] https flag for dev mode (#3603) --- v3/internal/commands/dev.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/v3/internal/commands/dev.go b/v3/internal/commands/dev.go index 20e36e049..c76d483ad 100644 --- a/v3/internal/commands/dev.go +++ b/v3/internal/commands/dev.go @@ -17,6 +17,7 @@ type DevOptions struct { Config string `description:"The config file including path" default:"./build/devmode.config.yaml"` VitePort int `name:"port" description:"Specify the vite dev server port"` + Secure bool `name:"s" description:"Enable HTTPS"` } func Dev(options *DevOptions) error { @@ -45,7 +46,11 @@ func Dev(options *DevOptions) error { os.Setenv(wailsVitePort, strconv.Itoa(port)) // Set url of frontend dev server - os.Setenv("FRONTEND_DEVSERVER_URL", fmt.Sprintf("http://%s:%d", host, port)) + if options.Secure { + os.Setenv("FRONTEND_DEVSERVER_URL", fmt.Sprintf("https://%s:%d", host, port)) + } else { + os.Setenv("FRONTEND_DEVSERVER_URL", fmt.Sprintf("http://%s:%d", host, port)) + } return Watcher(&WatcherOptions{ Config: options.Config,