diff options
-rw-r--r-- | cmd/dolmetschctl/dolmetschctl.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd/dolmetschctl/dolmetschctl.go b/cmd/dolmetschctl/dolmetschctl.go index 62b176d..26725dc 100644 --- a/cmd/dolmetschctl/dolmetschctl.go +++ b/cmd/dolmetschctl/dolmetschctl.go @@ -155,6 +155,11 @@ func run(ctrl *controller.Controller, ws *websocket.Conn) (error, bool) { func main() { log.Println("hello world.") + base_url := "127.0.0.1:8234" + if len(os.Args) > 1 { + base_url = os.Args[1] + } + c, err := controller.NewController(controller.Config{Dev: "dolmetsch controller"}) if err != nil { log.Printf("Error opening the controller: %v", err) @@ -169,7 +174,7 @@ func main() { log.Printf("controller successfully initialized!") for { - ws, _, err := websocket.DefaultDialer.Dial("ws://127.0.0.1:8234/api/v1/socket", nil) + ws, _, err := websocket.DefaultDialer.Dial("ws://"+base_url+"/api/v1/socket", nil) if err != nil { log.Printf("Error connecting to daemon: %v", err) } else { |