transport

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2020 License: GPL-3.0 Imports: 21 Imported by: 6

Documentation

Index

Constants

View Source
const Name = "TRANSPORT"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client implements tunnel.Client

func NewClient

func NewClient(ctx context.Context, c tunnel.Client) (*Client, error)

NewClient creates a transport layer client

func (*Client) Close

func (c *Client) Close() error

func (*Client) DialConn

func (c *Client) DialConn(*tunnel.Address, tunnel.Tunnel) (tunnel.Conn, error)

DialConn implements tunnel.Client. It will ignore the params and directly dial to remote server

func (*Client) DialPacket

func (c *Client) DialPacket(tunnel.Tunnel) (tunnel.PacketConn, error)

type Config

type Config struct {
	LocalHost       string                `json:"local_addr" yaml:"local-addr"`
	LocalPort       int                   `json:"local_port" yaml:"local-port"`
	RemoteHost      string                `json:"remote_addr" yaml:"remote-addr"`
	RemotePort      int                   `json:"remote_port" yaml:"remote-port"`
	TLS             TLSConfig             `json:"ssl" yaml:"ssl"`
	TransportPlugin TransportPluginConfig `json:"transport_plugin" yaml:"transport-plugin"`
	Websocket       WebsocketConfig       `json:"websocket" yaml:"websocket"`
}

type Conn

type Conn struct {
	net.Conn
}

func (*Conn) Metadata

func (c *Conn) Metadata() *tunnel.Metadata

type Server

type Server struct {
	PreferServerCipher bool
	// contains filtered or unexported fields
}

Server is a server of trasport layer

func NewServer

func NewServer(ctx context.Context, _ tunnel.Server) (*Server, error)

NewServer creates a transport layer server

func (*Server) AcceptConn

func (s *Server) AcceptConn(overlay tunnel.Tunnel) (tunnel.Conn, error)

func (*Server) AcceptPacket

func (s *Server) AcceptPacket(tunnel.Tunnel) (tunnel.PacketConn, error)

func (*Server) Close

func (s *Server) Close() error

type TLSConfig

type TLSConfig struct {
	Verify               bool     `json:"verify" yaml:"verify"`
	VerifyHostName       bool     `json:"verify_hostname" yaml:"verify-hostname"`
	CertPath             string   `json:"cert" yaml:"cert"`
	KeyPath              string   `json:"key" yaml:"key"`
	KeyPassword          string   `json:"key_password" yaml:"key-password"`
	Cipher               string   `json:"cipher" yaml:"cipher"`
	PreferServerCipher   bool     `json:"prefer_server_cipher" yaml:"prefer-server-cipher"`
	SNI                  string   `json:"sni" yaml:"sni"`
	HTTPResponseFileName string   `json:"plain_http_response" yaml:"plain-http-response"`
	FallbackHost         string   `json:"fallback_addr" yaml:"fallback-addr"`
	FallbackPort         int      `json:"fallback_port" yaml:"fallback-port"`
	ReuseSession         bool     `json:"reuse_session" yaml:"reuse-session"`
	ALPN                 []string `json:"alpn" yaml:"alpn"`
	Curves               string   `json:"curves" yaml:"curves"`
	Fingerprint          string   `json:"fingerprint" yaml:"fingerprint"`
	KeyLogPath           string   `json:"key_log" yaml:"key-log"`
	KeyBytes             []byte   `json:"key_bytes" yaml:"key-bytes"`
	CertBytes            []byte   `json:"cert_bytes" yaml:"cert-bytes"`
}

type TransportPluginConfig

type TransportPluginConfig struct {
	Enabled      bool     `json:"enabled" yaml:"enabled"`
	Type         string   `json:"type" yaml:"type"`
	Command      string   `json:"command" yaml:"command"`
	PluginOption string   `json:"plugin_option" yaml:"plugin-option"`
	Arg          []string `json:"arg" yaml:"arg"`
	Env          []string `json:"env" yaml:"env"`
}

type Tunnel

type Tunnel struct{}

func (*Tunnel) Name

func (*Tunnel) Name() string

func (*Tunnel) NewClient

func (*Tunnel) NewClient(ctx context.Context, client tunnel.Client) (tunnel.Client, error)

func (*Tunnel) NewServer

func (*Tunnel) NewServer(ctx context.Context, server tunnel.Server) (tunnel.Server, error)

type WebsocketConfig

type WebsocketConfig struct {
	Enabled bool `json:"enabled" yaml:"enabled"'`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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