MCPcopy Create free account
hub / github.com/kataras/iris / GetContext

Function GetContext

websocket/websocket.go:221–226  ·  view source on GitHub ↗

GetContext returns the Iris Context from a websocket connection. Note that writing to the client connection through this Context is not allowed from a websocket event because the connection is hijacked. If used, you are limited for read-only access of the request e.g. read the request headers.

(c *neffos.Conn)

Source from the content-addressed store, hash-verified

219// from a websocket event because the connection is hijacked.
220// If used, you are limited for read-only access of the request e.g. read the request headers.
221func GetContext(c *neffos.Conn) *context.Context {
222 if sw, ok := c.Socket().(*socketWrapper); ok {
223 return sw.ctx
224 }
225 return nil
226}

Callers 5

OnChatMethod · 0.92
OnChatMethod · 0.92
server.goFile · 0.92
makeInjectorFunction · 0.92
HandlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…