first commit
This commit is contained in:
21
handlers/websocket_handler.go
Normal file
21
handlers/websocket_handler.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
ws "stocksearch/websocket"
|
||||
)
|
||||
|
||||
// WSHandler WebSocket 핸들러
|
||||
type WSHandler struct {
|
||||
hub *ws.Hub
|
||||
}
|
||||
|
||||
// NewWSHandler 핸들러 초기화
|
||||
func NewWSHandler(hub *ws.Hub) *WSHandler {
|
||||
return &WSHandler{hub: hub}
|
||||
}
|
||||
|
||||
// ServeWS GET /ws - WebSocket 연결 처리
|
||||
func (h *WSHandler) ServeWS(w http.ResponseWriter, r *http.Request) {
|
||||
h.hub.ServeWS(w, r)
|
||||
}
|
||||
Reference in New Issue
Block a user