cmd: remove a broken thing
This commit is contained in:
parent
4e4da828b5
commit
4186b0c6b0
|
@ -1,41 +0,0 @@
|
|||
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() {
|
||||
flag.Parse()
|
||||
client, err := rpc.DialHTTP("tcp", *addr)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
pKey, err := rsa.GenerateKey(rand.Reader, 1024)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
req := routerpc.AddHostRequest{
|
||||
APIKey: "hunter2",
|
||||
PrivKey: pKey,
|
||||
}
|
||||
resp := &routerpc.AddHostResponse{}
|
||||
|
||||
err = client.Call("Urls.AddHost", req, resp)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
log.Printf("Created host %s (%s) with token %s", resp.Hostname, resp.OnionHostname, resp.Token)
|
||||
}
|
Loading…
Reference in New Issue