diff --git a/cmd/route-httpagent/main.go b/cmd/route-httpagent/main.go index 8c74581..12feafa 100644 --- a/cmd/route-httpagent/main.go +++ b/cmd/route-httpagent/main.go @@ -4,6 +4,7 @@ import ( "context" "crypto/tls" "flag" + "time" "git.xeserv.us/xena/route/internal/tun2" "github.com/Xe/ln" @@ -32,8 +33,13 @@ func main() { } client, _ := tun2.NewClient(cfg) - err := client.Connect() - if err != nil { - ln.FatalErr(context.Background(), err, ln.Action("http agent is now running")) + + for { + err := client.Connect() + if err != nil { + ln.Error(context.Background(), err, ln.Action("client connection failed")) + } + + time.Sleep(2 * time.Second) } }