feat(ws): release generic WebSocket client and server v0.31.0-preview

This commit is contained in:
2026-10-29 19:20:12 +08:00
parent 19ee9746e9
commit 3272974bc1
58 changed files with 7654 additions and 21 deletions

View File

@@ -275,6 +275,14 @@ func (c *Context) Status() int {
// Responded reports whether this handler has already written a response.
func (c *Context) Responded() bool { return c.responded }
// MarkUpgraded records a successful WebSocket HTTP/1.1 upgrade whose 101 bytes
// were written directly to a hijacked connection. Call only after a successful
// upgrade; it does not write headers or upgrade a connection itself.
func (c *Context) MarkUpgraded() {
c.responded = true
c.status = http.StatusSwitchingProtocols
}
// WriteError writes a stable public error response. Internal causes are not
// serialized. Responses committed through Context methods or Raw are preserved.
func (c *Context) WriteError(err error) {