Documentation
¶
Overview ¶
Package wsx provides Fiber-v3-compatible WebSocket support via fasthttp/websocket. The public surface is intentionally small:
app.Get("/ws", wsx.Upgrade(func(c *wsx.Conn) error {
for {
_, msg, err := c.ReadMessage()
if err != nil { return err }
_ = c.WriteMessage(wsx.TextMessage, msg)
}
}))
A typed op that answers a WebSocket returns a zip.Socket instead; both run the same upgrade (internal/ws).
Index ¶
Constants ¶
View Source
const ( TextMessage = websocket.TextMessage BinaryMessage = websocket.BinaryMessage CloseMessage = websocket.CloseMessage PingMessage = websocket.PingMessage PongMessage = websocket.PongMessage )
Message-type constants re-exported for convenience.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
Config configures the WebSocket upgrade. It is the type zip.Socket's Config field holds.
Click to show internal directories.
Click to hide internal directories.