MCPcopy Index your code
hub / github.com/cloudflare/cloudflared / Handle

Method Handle

socks/request_handler.go:35–49  ·  view source on GitHub ↗

Handle processes and responds to socks5 commands

(req *Request, conn io.ReadWriter)

Source from the content-addressed store, hash-verified

33
34// Handle processes and responds to socks5 commands
35func (h *StandardRequestHandler) Handle(req *Request, conn io.ReadWriter) error {
36 switch req.Command {
37 case connectCommand:
38 return h.handleConnect(conn, req)
39 case bindCommand:
40 return h.handleBind(conn, req)
41 case associateCommand:
42 return h.handleAssociate(conn, req)
43 default:
44 if err := sendReply(conn, commandNotSupported, nil); err != nil {
45 return fmt.Errorf("Failed to send reply: %v", err)
46 }
47 return fmt.Errorf("Unsupported command: %v", req.Command)
48 }
49}
50
51// handleConnect is used to handle a connect command
52func (h *StandardRequestHandler) handleConnect(conn io.ReadWriter, req *Request) error {

Callers

nothing calls this directly

Calls 5

handleConnectMethod · 0.95
handleBindMethod · 0.95
handleAssociateMethod · 0.95
sendReplyFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected