tcpto6

package module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2022 License: AGPL-3.0 Imports: 9 Imported by: 0

README

Go Reference

tcp4to6

Listen on a tcp4 address passed by systemd and forward connections to a specified tcp6 address. Except for the systemd socket path this could be done with tools like socat but I want to have something that can do exactly that and nothing more.

This project is released under GNU Affero General Public License v3.0, see LICENCE file in this repo for more info.

Documentation

Overview

Package tcpto6 provides an program that takes a net.Listener from systemd and accepts connections from it. For each accepted connection it dials to a predefined tcp6 address and bridges the connection if the dial succeeds.

Index

Constants

View Source
const ToAddrEnvName = "TCPTO6_DESTINATION_ADDR"

ToAddrEnvName is the name of the environment variable that contains the address that should be dialed for accepted connections. Must be in a format that net.Dial understands.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, log logr.Logger) error

Run fetches the listening socket from systemd, the target address from the env var and calls handleListener with them. It closes the listener when the given context ctx is canceled.

The source code repository contains the directory /init with an example .service and .socket file.

Types

This section is empty.

Directories

Path Synopsis
cmd
tcpto6
Package main provides an entry point to tcp4to6.Run.
Package main provides an entry point to tcp4to6.Run.

Jump to

Keyboard shortcuts

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