use conn.RemoteAddr() for remote addr
This commit is contained in:
parent
2d6bdd9fb5
commit
ff11c335dc
@ -149,14 +149,16 @@ func handleConnection(conn net.Conn, args ...string) {
|
|||||||
// prepare environment according to tcp-environ(5)
|
// prepare environment according to tcp-environ(5)
|
||||||
lh, lp, err := net.SplitHostPort(conn.LocalAddr().String())
|
lh, lp, err := net.SplitHostPort(conn.LocalAddr().String())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println("net.SplitHostPort(conn.LocalAddr()):", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
rh, rp, err := net.SplitHostPort(conn.LocalAddr().String())
|
|
||||||
|
rh, rp, err := net.SplitHostPort(conn.RemoteAddr().String())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println("net.SplitHostPort(conn.RemoteAddr()):", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd.Env = make([]string, 0)
|
cmd.Env = make([]string, 0)
|
||||||
cmd.Env = append(cmd.Env, "PATH="+os.Getenv("PATH"))
|
cmd.Env = append(cmd.Env, "PATH="+os.Getenv("PATH"))
|
||||||
cmd.Env = append(cmd.Env, "PROTO=TCP")
|
cmd.Env = append(cmd.Env, "PROTO=TCP")
|
||||||
|
Loading…
Reference in New Issue
Block a user