tun2: add logging calls to client connections

This commit is contained in:
Cadey Ratio 2017-03-26 15:13:54 -07:00
parent 92d23eec09
commit 65f99d052b
1 changed files with 5 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import (
"crypto/tls" "crypto/tls"
"encoding/json" "encoding/json"
"errors" "errors"
"log"
"net" "net"
"net/http" "net/http"
"net/http/httputil" "net/http/httputil"
@ -76,6 +77,8 @@ func (c *Client) connect(serverAddr string) error {
} }
defer conn.Close() defer conn.Close()
log.Printf("tun2: connected to %s (%v)", conn.RemoteAddr(), c.cfg.ConnType)
session, err := smux.Client(conn, smux.DefaultConfig()) session, err := smux.Client(conn, smux.DefaultConfig())
if err != nil { if err != nil {
return err return err
@ -100,6 +103,8 @@ func (c *Client) connect(serverAddr string) error {
return err return err
} }
log.Println("tun2: client set up and waiting for requests")
err = s.Serve(&smuxListener{ err = s.Serve(&smuxListener{
conn: conn, conn: conn,
session: session, session: session,