diff --git a/tlsserver.go b/tlsserver.go index c92c660..7bae358 100644 --- a/tlsserver.go +++ b/tlsserver.go @@ -149,14 +149,16 @@ func handleConnection(conn net.Conn, args ...string) { // prepare environment according to tcp-environ(5) lh, lp, err := net.SplitHostPort(conn.LocalAddr().String()) if err != nil { - log.Println(err) + log.Println("net.SplitHostPort(conn.LocalAddr()):", err) return } - rh, rp, err := net.SplitHostPort(conn.LocalAddr().String()) + + rh, rp, err := net.SplitHostPort(conn.RemoteAddr().String()) if err != nil { - log.Println(err) + log.Println("net.SplitHostPort(conn.RemoteAddr()):", err) return } + cmd.Env = make([]string, 0) cmd.Env = append(cmd.Env, "PATH="+os.Getenv("PATH")) cmd.Env = append(cmd.Env, "PROTO=TCP")