plugins/autohttpagent: fix for ln api change

This commit is contained in:
Cadey Ratio 2017-10-01 08:14:54 -07:00
parent 334f483574
commit 9b56d5f1ce
No known key found for this signature in database
GPG Key ID: D607EE27C2E7F89A
1 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,9 @@
// +build linux
package main package main
import ( import (
"context"
"crypto/tls" "crypto/tls"
"log" "log"
"os" "os"
@ -31,6 +34,9 @@ func mustEnv(key string, def string) string {
func doHttpAgent() { func doHttpAgent() {
go func() { go func() {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
cfg := &tun2.ClientConfig{ cfg := &tun2.ClientConfig{
TLSConfig: &tls.Config{}, TLSConfig: &tls.Config{},
ConnType: connMethod, ConnType: connMethod,
@ -43,9 +49,7 @@ func doHttpAgent() {
client, _ := tun2.NewClient(cfg) client, _ := tun2.NewClient(cfg)
err := client.Connect() err := client.Connect()
if err != nil { if err != nil {
ln.Error(err, ln.F{ ln.Error(ctx, err, ln.Action("client connection error, restarting"))
"action": "client_running",
})
time.Sleep(5 * time.Second) time.Sleep(5 * time.Second)