Documentation
¶
Overview ¶
Package proxy provides utilities for bidirectional data transfer between connections.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bidirectional ¶
func Bidirectional(conn1, conn2 io.ReadWriteCloser) error
Bidirectional copies data between two io.ReadWriteCloser connections. It blocks until both directions are done (either due to EOF or error). Both connections are closed when the function returns.
When one direction completes (EOF), it calls CloseWrite on the destination to signal EOF to the other side, allowing graceful half-close semantics. This prevents abrupt connection termination and allows in-flight data to complete.
Returns the first non-EOF error encountered, or nil if both directions completed successfully.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.