1
0
mirror of https://github.com/rancher/norman.git synced 2025-08-25 02:18:37 +00:00
norman/pkg/remotedialer/client/main.go
2018-10-23 22:46:45 -07:00

35 lines
623 B
Go

// +build !windows
package main
import (
"flag"
"net/http"
"github.com/rancher/norman/pkg/remotedialer"
"github.com/sirupsen/logrus"
)
var (
addr string
id string
debug bool
)
func main() {
flag.StringVar(&addr, "connect", "ws://localhost:8123/connect", "Address to connect to")
flag.StringVar(&id, "id", "foo", "Client ID")
flag.BoolVar(&debug, "debug", true, "Debug logging")
flag.Parse()
if debug {
logrus.SetLevel(logrus.DebugLevel)
}
headers := http.Header{
"X-Tunnel-ID": []string{id},
}
remotedialer.ClientConnect(addr, headers, nil, func(string, string) bool { return true }, nil)
}