This commit is contained in:
ryan
2026-06-18 16:08:48 +08:00
parent 3366edb3a1
commit 772962c2e9
156 changed files with 23460 additions and 183 deletions
@@ -0,0 +1,26 @@
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
package websocket
import (
"net/http"
"github.com/gorilla/websocket"
)
const (
messageTypePing = "ping"
messageTypePong = "pong"
messageTypeNotify = "notify"
)
// Message is a JSON-framed websocket payload.
type Message struct {
Type string `json:"type"`
Payload any `json:"payload,omitempty"`
}
var upgrader = websocket.Upgrader{
CheckOrigin: func(_ *http.Request) bool { return true },
}