plugins/autohttpagent: fix for ln api change
This commit is contained in:
parent
334f483574
commit
9b56d5f1ce
|
@ -1,6 +1,9 @@
|
|||
// +build linux
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"log"
|
||||
"os"
|
||||
|
@ -31,6 +34,9 @@ func mustEnv(key string, def string) string {
|
|||
|
||||
func doHttpAgent() {
|
||||
go func() {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
|
||||
cfg := &tun2.ClientConfig{
|
||||
TLSConfig: &tls.Config{},
|
||||
ConnType: connMethod,
|
||||
|
@ -43,9 +49,7 @@ func doHttpAgent() {
|
|||
client, _ := tun2.NewClient(cfg)
|
||||
err := client.Connect()
|
||||
if err != nil {
|
||||
ln.Error(err, ln.F{
|
||||
"action": "client_running",
|
||||
})
|
||||
ln.Error(ctx, err, ln.Action("client connection error, restarting"))
|
||||
|
||||
time.Sleep(5 * time.Second)
|
||||
|
||||
|
|
Loading…
Reference in New Issue