feat: server.Conn 支持通过 GetServer 获取到服务器实例

This commit is contained in:
kercylan98 2023-10-21 18:20:12 +08:00
parent 803dd4f2eb
commit 89e9c517af
1 changed files with 5 additions and 0 deletions

View File

@ -127,6 +127,11 @@ type connection struct {
mu sync.Mutex mu sync.Mutex
} }
// GetServer 获取服务器
func (slf *Conn) GetServer() *Server {
return slf.server
}
// GetWebsocketRequest 获取websocket请求 // GetWebsocketRequest 获取websocket请求
func (slf *Conn) GetWebsocketRequest() *http.Request { func (slf *Conn) GetWebsocketRequest() *http.Request {
return slf.GetData(wsRequestKey).(*http.Request) return slf.GetData(wsRequestKey).(*http.Request)