MCPcopy
hub / github.com/cloudflare/cloudflared / proxyLocalRequest

Method proxyLocalRequest

proxy/proxy.go:351–360  ·  view source on GitHub ↗
(proxy ingress.HTTPLocalProxy, w connection.ResponseWriter, req *http.Request, isWebsocket bool)

Source from the content-addressed store, hash-verified

349}
350
351func (p *Proxy) proxyLocalRequest(proxy ingress.HTTPLocalProxy, w connection.ResponseWriter, req *http.Request, isWebsocket bool) {
352 if isWebsocket {
353 // These headers are added since they are stripped off during an eyeball request to origintunneld, but they
354 // are required during the Handshake process of a WebSocket request.
355 req.Header.Set("Connection", "Upgrade")
356 req.Header.Set("Upgrade", "websocket")
357 req.Header.Set("Sec-Websocket-Version", "13")
358 }
359 proxy.ServeHTTP(w, req)
360}
361
362type bidirectionalStream struct {
363 reader io.Reader

Callers 1

ProxyHTTPMethod · 0.95

Calls 2

SetMethod · 0.45
ServeHTTPMethod · 0.45

Tested by

no test coverage detected