MCPcopy Create free account
hub / github.com/M1r0ku/frp-Modify / WithResponse

Function WithResponse

frp-dev/test/e2e/mock/server/httpserver/server.go:62–69  ·  view source on GitHub ↗
(resp []byte)

Source from the content-addressed store, hash-verified

60}
61
62func WithResponse(resp []byte) Option {
63 return func(s *Server) *Server {
64 s.handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
65 _, _ = w.Write(resp)
66 })
67 return s
68 }
69}
70
71func (s *Server) Run() error {
72 if err := s.initListener(); err != nil {

Callers

nothing calls this directly

Calls 1

WriteMethod · 0.45

Tested by

no test coverage detected