proxy

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2026 License: MIT Imports: 3 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL