summaryrefslogtreecommitdiff
path: root/pkg/helper/windows.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/helper/windows.go')
-rw-r--r--pkg/helper/windows.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/helper/windows.go b/pkg/helper/windows.go
index fc80853..376b376 100644
--- a/pkg/helper/windows.go
+++ b/pkg/helper/windows.go
@@ -21,6 +21,7 @@ import (
"log"
"os"
"os/exec"
+ "strconv"
"strings"
"0xacab.org/leap/bitmask-vpn/pkg/config"
@@ -97,7 +98,10 @@ func usage(errmsg string) {
func daemonize() {}
// http server is called from within Execute in windows
-func doHandleCommands(bindAddr string) {
+func doHandleCommands(preferredPort int) {
+ port := getFirstAvailablePortFrom(preferredPort)
+ writePortToFile(port)
+ bindAddr := "localhost:" + strconv.Itoa(port)
httpBindAddr = bindAddr
}