dokodemo

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MPL-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proxy_dokodemo_config_proto protoreflect.FileDescriptor

Functions

func FakeUDP

func FakeUDP(addr *net.UDPAddr, mark int) (net.PacketConn, error)

func NewPacketWriter

func NewPacketWriter(conn net.PacketConn, d *net.Destination, mark int, back *net.UDPAddr) buf.Writer

Types

type Config

type Config struct {
	RewriteAddress *net.IPOrDomain   `protobuf:"bytes,1,opt,name=rewrite_address,json=rewriteAddress,proto3" json:"rewrite_address,omitempty"`
	RewritePort    uint32            `protobuf:"varint,2,opt,name=rewrite_port,json=rewritePort,proto3" json:"rewrite_port,omitempty"`
	PortMap        map[string]string `` /* 156-byte string literal not displayed */
	// List of networks that the Dokodemo accepts.
	AllowedNetworks []net.Network `` /* 143-byte string literal not displayed */
	FollowRedirect  bool          `protobuf:"varint,5,opt,name=follow_redirect,json=followRedirect,proto3" json:"follow_redirect,omitempty"`
	UserLevel       uint32        `protobuf:"varint,6,opt,name=user_level,json=userLevel,proto3" json:"user_level,omitempty"`
	// contains filtered or unexported fields
}

func (*Config) Descriptor deprecated

func (*Config) Descriptor() ([]byte, []int)

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) GetAllowedNetworks

func (x *Config) GetAllowedNetworks() []net.Network

func (*Config) GetFollowRedirect

func (x *Config) GetFollowRedirect() bool

func (*Config) GetPortMap

func (x *Config) GetPortMap() map[string]string

func (*Config) GetPredefinedAddress

func (v *Config) GetPredefinedAddress() net.Address

GetPredefinedAddress returns the defined address from proto config. Null if address is not valid.

func (*Config) GetRewriteAddress

func (x *Config) GetRewriteAddress() *net.IPOrDomain

func (*Config) GetRewritePort

func (x *Config) GetRewritePort() uint32

func (*Config) GetUserLevel

func (x *Config) GetUserLevel() uint32

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) ProtoReflect

func (x *Config) ProtoReflect() protoreflect.Message

func (*Config) Reset

func (x *Config) Reset()

func (*Config) String

func (x *Config) String() string

type DokodemoDoor

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

func (*DokodemoDoor) Init

func (d *DokodemoDoor) Init(config *Config, pm policy.Manager, sockopt *session.Sockopt) error

Init initializes the DokodemoDoor instance with necessary parameters.

func (*DokodemoDoor) Network

func (d *DokodemoDoor) Network() []net.Network

Network implements proxy.Inbound.

func (*DokodemoDoor) Process

func (d *DokodemoDoor) Process(ctx context.Context, network net.Network, conn stat.Connection, dispatcher routing.Dispatcher) error

Process implements proxy.Inbound.

type PacketWriter

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

func (*PacketWriter) Close

func (w *PacketWriter) Close() error

func (*PacketWriter) WriteMultiBuffer

func (w *PacketWriter) WriteMultiBuffer(mb buf.MultiBuffer) error

Jump to

Keyboard shortcuts

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