MCPcopy
hub / github.com/coder/websocket / echoServer

Function echoServer

internal/thirdparty/gin_test.go:54–65  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request, opts *websocket.AcceptOptions)

Source from the content-addressed store, hash-verified

52}
53
54func echoServer(w http.ResponseWriter, r *http.Request, opts *websocket.AcceptOptions) (err error) {
55 defer errd.Wrap(&err, "echo server failed")
56
57 c, err := websocket.Accept(w, r, opts)
58 if err != nil {
59 return err
60 }
61 defer c.Close(websocket.StatusInternalError, "")
62
63 err = wstest.EchoLoop(r.Context(), c)
64 return assertCloseStatus(websocket.StatusNormalClosure, err)
65}
66
67func assertCloseStatus(exp websocket.StatusCode, err error) error {
68 if websocket.CloseStatus(err) == -1 {

Callers 1

TestGinFunction · 0.70

Calls 5

WrapFunction · 0.92
AcceptFunction · 0.92
EchoLoopFunction · 0.92
assertCloseStatusFunction · 0.70
CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…