dns

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FakeIP = 0
	Bypass = 1
	Proxy  = 2
)
View Source
const (
	MaxPacketSize = 1024 * 8
)
View Source
const Name = "DNS"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

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

func (*Client) Close

func (c *Client) Close() error

func (*Client) DialConn

func (c *Client) DialConn(address *tunnel.Address, user statistic.User, metadata *tunnel.Metadata, overlay tunnel.Tunnel) (tunnel.Conn, error)

func (*Client) DialPacket

func (c *Client) DialPacket(user statistic.User, overlay tunnel.Tunnel) (tunnel.PacketConn, error)

func (*Client) LookBackAddress

func (c *Client) LookBackAddress(address *tunnel.Address) *tunnel.Address

type Config

type Config struct {
	RunType string    `json:"run_type" yaml:"run-type"`
	Dns     DnsConfig `json:"dns" yaml:"dns"`
}

type Conn

type Conn struct {
	tunnel.Conn
	// contains filtered or unexported fields
}

func (*Conn) Close added in v1.0.8

func (c *Conn) Close() error

func (*Conn) Name

func (c *Conn) Name() string

func (*Conn) Read

func (c *Conn) Read(p []byte) (int, error)

func (*Conn) Tunnels

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

func (*Conn) Write

func (c *Conn) Write(p []byte) (int, error)

type DnsConfig

type DnsConfig struct {
	Enabled       bool     `json:"enabled" yaml:"enabled"`
	Bypass        []string `json:"bypass" yaml:"bypass"`
	Proxy         []string `json:"proxy" yaml:"proxy"`
	FakeIP        []string `json:"fakeip" yaml:"fakeip"`
	FakeIPRange   string   `json:"fakeip_range" yaml:"fakeip-range"`
	DefaultPolicy string   `json:"default_policy" yaml:"default-policy"`
}

type OutboundPacketConn added in v1.0.8

type OutboundPacketConn struct {
	tunnel.PacketConn
	// contains filtered or unexported fields
}

func (*OutboundPacketConn) Tunnels added in v1.0.8

func (c *OutboundPacketConn) Tunnels() *tunnel.Tunnels

func (*OutboundPacketConn) WriteWithMetadata added in v1.0.8

func (c *OutboundPacketConn) WriteWithMetadata(p []byte, m *tunnel.Metadata) (int, error)

type PacketConn

type PacketConn struct {
	tunnel.PacketConn
	// contains filtered or unexported fields
}

func (*PacketConn) Name

func (c *PacketConn) Name() string

func (*PacketConn) ReadWithMetadata

func (c *PacketConn) ReadWithMetadata(p []byte) (int, *tunnel.Metadata, error)

func (*PacketConn) Tunnels

func (c *PacketConn) Tunnels() *tunnel.Tunnels

type Server added in v1.0.8

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

func NewServer added in v1.0.8

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

func (*Server) AcceptConn added in v1.0.8

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

func (*Server) AcceptPacket added in v1.0.8

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

func (*Server) Close added in v1.0.8

func (s *Server) Close() error

func (*Server) Route added in v1.0.8

func (server *Server) Route(domain string) int

type Tunnel

type Tunnel struct{}

func (*Tunnel) Name

func (t *Tunnel) Name() string

func (*Tunnel) NewClient

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

func (*Tunnel) NewServer

func (t *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