diff options
author | Christian Pointner <equinox@spreadspace.org> | 2019-02-23 17:00:20 +0100 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2019-02-23 17:00:20 +0100 |
commit | 060858b588883034e1828f314b458704a7eb1f90 (patch) | |
tree | a98afd8a7bae07e07e976ad98bce76ae8f2ea1d3 /cmd/dolmetschctl | |
parent | automatic reconnect for mixer devices (diff) |
make server url configurable
Diffstat (limited to 'cmd/dolmetschctl')
-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 { |