proxy

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package proxy makes it possible to forward a listening socket in situations where the proxy cannot connect to some other address. Instead, it creates two listening sockets, pairs two incoming connections and then moves data back and forth. This matches the behavior of the following socat command: socat -d -d -d UNIX-LISTEN:/tmp/socat,fork TCP-LISTEN:9000,reuseport

The advantage over that command is that both listening sockets are always open, in contrast to the socat solution where the TCP port is only open when there actually is a connection available.

To establish a connection, someone has to poll the proxy with a dialer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, endpoint1, endpoint2 string) (io.Closer, error)

New listens on both endpoints and starts accepting connections until closed or the context is done.

Types

This section is empty.

Jump to

Keyboard shortcuts

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