add local addr and remote addr function to session

This commit is contained in:
parkerzhu
2019-07-16 01:50:40 +08:00
committed by Ola
parent fd663c8c45
commit aaf226f3d1
+5 -4
View File
@@ -1,6 +1,7 @@
package melody package melody
import ( import (
"net"
"net/http" "net/http"
"sync" "sync"
"time" "time"
@@ -220,11 +221,11 @@ func (s *Session) IsClosed() bool {
} }
// LocalAddr returns the local addr of the connection. // LocalAddr returns the local addr of the connection.
func (s *session) LocalAddr() net.Addr { func (s *Session) LocalAddr() net.Addr {
return conn.LocalAddr() return s.conn.LocalAddr()
} }
// RemoteAddr returns the remote addr of the connection. // RemoteAddr returns the remote addr of the connection.
func (s *session) RemoteAddr() net.Addr { func (s *Session) RemoteAddr() net.Addr {
return conn.RemoteAddr() return s.conn.RemoteAddr()
} }