viproxy

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: MPL-2.0 Imports: 7 Imported by: 3

README

VIProxy

The VIProxy package implements a TCP proxy that translates between AF_INET and AF_VSOCK connections. The proxy takes as input two addresses, one being AF_INET and the other being AF_VSOCK. The proxy then starts a TCP listener on the in-address and once it receives an incoming connection to the in-address, it establishes a TCP connection to the out-addresses. Once both connections are established, the proxy copies data back and forth.

The example directory contains a simple example of how one would use viproxy.

Documentation

Overview

Package viproxy implements a point-to-point TCP proxy that translates between AF_INET and AF_VSOCK. This facilitates communication to and from an AWS Nitro Enclave which constrains I/O to a VSOCK interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tuple

type Tuple struct {
	InAddr  net.Addr
	OutAddr net.Addr
}

Tuple contains two addresses; one to listen on for incoming TCP connections, and another one to forward TCP data to.

type VIProxy

type VIProxy struct {
	// contains filtered or unexported fields
}

VIProxy implements a TCP proxy that translates between AF_INET and AF_VSOCK.

func NewVIProxy

func NewVIProxy(tuples []*Tuple) *VIProxy

NewVIProxy returns a new VIProxy instance.

func (*VIProxy) Start

func (p *VIProxy) Start() error

Start starts the TCP proxy along with all given connection forwarding tuples. The function returns once all listeners are set up. The function returns the first error that occurred (if any) while setting up the listeners.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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