Skip to content

Commit

Permalink
add RemoteAddr function in session
Browse files Browse the repository at this point in the history
  • Loading branch information
kayabe committed Nov 7, 2021
1 parent 539aefd commit 3150c26
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package melody

import (
"errors"
"net"
"net/http"
"sync"
"time"
Expand Down Expand Up @@ -236,3 +237,8 @@ func (s *Session) MustGet(key string) interface{} {
func (s *Session) IsClosed() bool {
return s.closed()
}

// RemoteAddr returns RemoteAddr of the connection.
func (s *Session) RemoteAddr() net.Addr {
return s.conn.RemoteAddr()
}

0 comments on commit 3150c26

Please sign in to comment.