From a53c5d47b186ce1b114ad56e555518cbf1caaad0 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 27 Mar 2016 11:54:59 -0400 Subject: [PATCH] Added force wss flag Former-commit-id: f5be76c42fcbac8ad02fdf3f33fbb778d708a572 [formerly c0ccaf9c27ad8f4f61f73cc49051e5720226cb78] [formerly 3339f1503f89edc1ce65f71ac986cfc06d4a41ac [formerly 3c2a64ec0935ec21e5b71254fdefb1aa33a66f54]] Former-commit-id: ac62f91a7c5dab5c7a299bbd471f9862ebd048b0 [formerly 94ecb0cebb996c6ed88412c70e45a72e9fd322f0] Former-commit-id: 2448c0842558e7f04db3b08923b2cb458e767a53 --- main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.go b/main.go index 0e9c4bb..136947f 100644 --- a/main.go +++ b/main.go @@ -31,6 +31,7 @@ var RuntimeArgs struct { SourcePath string AdminKey string Socket string + ForceWss bool } var VersionNum string @@ -45,6 +46,7 @@ func main() { flag.StringVar(&RuntimeArgs.ServerCRT, "crt", "", "location of ssl crt") flag.StringVar(&RuntimeArgs.ServerKey, "key", "", "location of ssl key") flag.StringVar(&RuntimeArgs.WikiName, "w", "cowyo", "custom name for wiki") + flag.BoolVar(&RuntimeArgs.ForceWss, "e", false, "force encrypted sockets") dumpDataset := flag.Bool("dump", false, "flag to dump all data to 'dump' directory") flag.CommandLine.Usage = func() { fmt.Println(`cowyo (version ` + VersionNum + `): A Websocket Wiki and Kind Of A List Application @@ -113,6 +115,9 @@ Options:`) r.RunTLS(RuntimeArgs.Port, RuntimeArgs.ServerCRT, RuntimeArgs.ServerKey) } else { RuntimeArgs.Socket = "ws" + if RuntimeArgs.ForceWss { + RuntimeArgs.Socket = "wss" + } fmt.Println("--------------------------") fmt.Println("cowyo (version " + VersionNum + ") is up and running on http://" + RuntimeArgs.ExternalIP) fmt.Println("Admin key: " + RuntimeArgs.AdminKey)