transport

package
v0.0.0-...-a221a55 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

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, _ 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 the 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"`
	TransportPlugin TransportPluginConfig `json:"transport_plugin" yaml:"transport-plugin"`
}

type Conn

type Conn struct {
	net.Conn
}

func (*Conn) Metadata

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

type Server

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

Server is a server of transport 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 TransportPluginConfig

type TransportPluginConfig struct {
	Enabled bool     `json:"enabled" yaml:"enabled"`
	Type    string   `json:"type" yaml:"type"`
	Command string   `json:"command" yaml:"command"`
	Option  string   `json:"option" yaml:"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)

Jump to

Keyboard shortcuts

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