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

Function Pipe

stream/stream.go:88–90  ·  view source on GitHub ↗

Pipe copies copy data to & from provided io.ReadWriters.

(tunnelConn, originConn io.ReadWriter, log *zerolog.Logger)

Source from the content-addressed store, hash-verified

86
87// Pipe copies copy data to & from provided io.ReadWriters.
88func Pipe(tunnelConn, originConn io.ReadWriter, log *zerolog.Logger) {
89 _ = PipeBidirectional(NopCloseWriterAdapter(tunnelConn), NopCloseWriterAdapter(originConn), 0, log)
90}
91
92// PipeBidirectional copies data to two unidirectional streams. It is a special case of Pipe where it receives a concept that allows for Read and Write side to be closed independently.
93// The main difference is that when piping data from a reader to a writer, if EOF is read, then this implementation propagates the EOF signal to the destination/writer by closing the write side of the

Callers 8

wsEchoEndpointFunction · 0.92
wsFlakyEndpointFunction · 0.92
DefaultStreamHandlerFunction · 0.92
StreamMethod · 0.92
proxyHTTPRequestMethod · 0.92
proxyTCPStreamMethod · 0.92
ServeStreamMethod · 0.92

Calls 2

PipeBidirectionalFunction · 0.85
NopCloseWriterAdapterFunction · 0.85

Tested by 3

wsEchoEndpointFunction · 0.74
wsFlakyEndpointFunction · 0.74