mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
add CORS.
This commit is contained in:
@ -4,6 +4,8 @@ import "net/http"
|
||||
|
||||
type HandlerFunction func(Session, []byte) bool
|
||||
|
||||
type CheckOrigin func(r *http.Request) bool
|
||||
|
||||
type WebSocketPeer interface {
|
||||
Send(v interface{}) error
|
||||
Destroy() error
|
||||
@ -13,5 +15,5 @@ type WebSocketManager interface {
|
||||
Start()
|
||||
Shutdown() error
|
||||
AddHandler(handler HandlerFunction)
|
||||
Upgrade(w http.ResponseWriter, r *http.Request) error
|
||||
Upgrade(w http.ResponseWriter, r *http.Request, checkOrigin CheckOrigin) error
|
||||
}
|
||||
|
Reference in New Issue
Block a user