From a7b71026094ad2b80575d2e6671437a89f1d6598 Mon Sep 17 00:00:00 2001 From: Cadey Dodrill Date: Sun, 22 Jan 2017 10:20:33 -0800 Subject: [PATCH] cmd/api: custom rpc host --- cmd/api/main.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/api/main.go b/cmd/api/main.go index 8e5cb19..c3a8e2d 100644 --- a/cmd/api/main.go +++ b/cmd/api/main.go @@ -3,14 +3,20 @@ package main import ( "crypto/rand" "crypto/rsa" + "flag" "log" "net/rpc" "git.xeserv.us/xena/route/routerpc" ) +var ( + addr = flag.String("addr", "127.0.0.1:9234", "RPC host to connect to") +) + func main() { - client, err := rpc.DialHTTP("tcp", "127.0.0.1:9234") + flag.Parse() + client, err := rpc.DialHTTP("tcp", *addr) if err != nil { log.Fatal(err) }