cmd/api: custom rpc host
This commit is contained in:
parent
6bd43bbaa5
commit
a7b7102609
|
@ -3,14 +3,20 @@ package main
|
||||||
import (
|
import (
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"crypto/rsa"
|
"crypto/rsa"
|
||||||
|
"flag"
|
||||||
"log"
|
"log"
|
||||||
"net/rpc"
|
"net/rpc"
|
||||||
|
|
||||||
"git.xeserv.us/xena/route/routerpc"
|
"git.xeserv.us/xena/route/routerpc"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
addr = flag.String("addr", "127.0.0.1:9234", "RPC host to connect to")
|
||||||
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
client, err := rpc.DialHTTP("tcp", "127.0.0.1:9234")
|
flag.Parse()
|
||||||
|
client, err := rpc.DialHTTP("tcp", *addr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue