feat(ws): release generic WebSocket client and server v0.31.0-preview
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user