Commit 98f4154c authored by Eric's avatar Eric

fix ip addr bug

parent e61e6d76
......@@ -2,7 +2,7 @@ package handler
import (
"io"
"strings"
"net"
"sync"
"github.com/gliderlabs/ssh"
......@@ -85,7 +85,8 @@ func (w *WrapperSession) LoginFrom() string {
}
func (w *WrapperSession) RemoteAddr() string {
return strings.Split(w.Sess.RemoteAddr().String(), ":")[0]
host, _, _ := net.SplitHostPort(w.Sess.RemoteAddr().String())
return host
}
func (w *WrapperSession) Pty() ssh.Pty {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment