1
0
mirror of https://github.com/rancher/norman.git synced 2025-08-26 19:08:27 +00:00
norman/pkg/remotedialer/client/main.go

35 lines
623 B
Go
Raw Normal View History

// +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)
}