Skip to content

Commit

Permalink
print address on compressed connection
Browse files Browse the repository at this point in the history
  • Loading branch information
xtaci committed Jul 11, 2019
1 parent 3b01e69 commit b4473a5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions generic/comp.go
Expand Up @@ -32,6 +32,24 @@ func (c *CompStream) Close() error {
return c.conn.Close()
}

func (c *CompStream) LocalAddr() net.Addr {
if ts, ok := c.conn.(interface {
LocalAddr() net.Addr
}); ok {
return ts.LocalAddr()
}
return nil
}

func (c *CompStream) RemoteAddr() net.Addr {
if ts, ok := c.conn.(interface {
RemoteAddr() net.Addr
}); ok {
return ts.RemoteAddr()
}
return nil
}

func NewCompStream(conn net.Conn) *CompStream {
c := new(CompStream)
c.conn = conn
Expand Down

0 comments on commit b4473a5

Please sign in to comment.