nat

package
v1.1.1-rc.3 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SO_ORIGINAL_DST      = 80
	IP6T_SO_ORIGINAL_DST = 80
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Proto string
	Ip    string
	Port  string
}

type Entry

type Entry struct {
	Destination Address
	Port        string
}

func (*Entry) String

func (e *Entry) String() string

type Translator

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

func NewTranslator

func NewTranslator(name string) *Translator

func (*Translator) ClearTCP

func (t *Translator) ClearTCP(p *supervisor.Process, ip, port string)

func (*Translator) ClearUDP

func (t *Translator) ClearUDP(p *supervisor.Process, ip, port string)

func (*Translator) Disable

func (t *Translator) Disable(p *supervisor.Process)

func (*Translator) Enable

func (t *Translator) Enable(p *supervisor.Process)

func (*Translator) ForwardTCP

func (t *Translator) ForwardTCP(p *supervisor.Process, ip, port, toPort string)

func (*Translator) ForwardUDP

func (t *Translator) ForwardUDP(p *supervisor.Process, ip, port, toPort string)

func (*Translator) GetOriginalDst

func (t *Translator) GetOriginalDst(conn *net.TCPConn) (rawaddr []byte, host string, err error)

get the original destination for the socket when redirect by linux iptables refer to https://raw.githubusercontent.com/missdeer/avege/master/src/inbound/redir/redir_iptables.go

Jump to

Keyboard shortcuts

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