summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2019-02-23 16:00:20 (GMT)
committerChristian Pointner <equinox@spreadspace.org>2019-02-23 16:00:20 (GMT)
commit060858b588883034e1828f314b458704a7eb1f90 (patch)
treea98afd8a7bae07e07e976ad98bce76ae8f2ea1d3
parentdf7430d20269c45843ae6cc56b5424bc98be2b31 (diff)
make server url configurable
-rw-r--r--cmd/dolmetschctl/dolmetschctl.go7
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 {