Documentation
¶
Index ¶
- Constants
- Variables
- type Client
- func (p *Client) Accept() error
- func (p *Client) AcceptDirectTcpConn(conn *net.TCPConn, targetAddr string)
- func (p *Client) AcceptSock5Conn(conn *net.TCPConn)
- func (p *Client) AcceptTcp() error
- func (p *Client) AcceptTcpConn(conn *net.TCPConn, targetAddr string)
- func (p *Client) Addr() string
- func (p *Client) ICMPAddr() string
- func (p *Client) IPAddr() *net.UDPAddr
- func (p *Client) LocalAddrToConnMapSize() int
- func (p *Client) LocalIdToConnMapSize() int
- func (p *Client) RTT() time.Duration
- func (p *Client) RecvPacket() uint64
- func (p *Client) RecvPacketSize() uint64
- func (p *Client) Run() error
- func (p *Client) SendPacket() uint64
- func (p *Client) SendPacketSize() uint64
- func (p *Client) ServerAddr() string
- func (p *Client) ServerIPAddr() *net.IPAddr
- func (p *Client) Stop()
- func (p *Client) TargetAddr() string
- type ClientConn
- type CryptoConfig
- type EncryptionMode
- type MyMsg
- func (*MyMsg) Descriptor() ([]byte, []int)deprecated
- func (x *MyMsg) GetData() []byte
- func (x *MyMsg) GetId() string
- func (x *MyMsg) GetKey() int32
- func (x *MyMsg) GetMagic() int32
- func (x *MyMsg) GetRproto() int32
- func (x *MyMsg) GetTarget() string
- func (x *MyMsg) GetTcpmode() int32
- func (x *MyMsg) GetTcpmodeBuffersize() int32
- func (x *MyMsg) GetTcpmodeCompress() int32
- func (x *MyMsg) GetTcpmodeMaxwin() int32
- func (x *MyMsg) GetTcpmodeResendTimems() int32
- func (x *MyMsg) GetTcpmodeStat() int32
- func (x *MyMsg) GetTimeout() int32
- func (x *MyMsg) GetType() int32
- func (*MyMsg) ProtoMessage()
- func (x *MyMsg) ProtoReflect() protoreflect.Message
- func (x *MyMsg) Reset()
- func (x *MyMsg) String() string
- type MyMsg_TYPE
- type Packet
- type Server
- type ServerConn
Constants ¶
View Source
const ( SEND_PROTO int = 8 RECV_PROTO int = 0 )
View Source
const ( FRAME_MAX_SIZE int = 888 FRAME_MAX_ID int = 1000000 )
Variables ¶
View Source
var ( MyMsg_TYPE_name = map[int32]string{ 0: "DATA", 1: "PING", 2: "KICK", 57005: "MAGIC", } MyMsg_TYPE_value = map[string]int32{ "DATA": 0, "PING": 1, "KICK": 2, "MAGIC": 57005, } )
Enum value maps for MyMsg_TYPE.
View Source
var File_msg_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(addr string, server string, target string, timeout int, key int, icmpAddr string, tcpmode int, tcpmode_buffersize int, tcpmode_maxwin int, tcpmode_resend_timems int, tcpmode_compress int, tcpmode_stat int, open_sock5 int, maxconn int, sock5_filter *func(addr string) bool, cryptoConfig *CryptoConfig) (*Client, error)
func (*Client) AcceptDirectTcpConn ¶
func (*Client) AcceptSock5Conn ¶
func (*Client) LocalAddrToConnMapSize ¶
func (*Client) LocalIdToConnMapSize ¶
func (*Client) RecvPacket ¶
func (*Client) RecvPacketSize ¶
func (*Client) SendPacket ¶
func (*Client) SendPacketSize ¶
func (*Client) ServerAddr ¶
func (*Client) ServerIPAddr ¶
func (*Client) TargetAddr ¶
type ClientConn ¶
type ClientConn struct {
// contains filtered or unexported fields
}
type CryptoConfig ¶
type CryptoConfig struct {
Mode EncryptionMode
Key []byte
Cipher cipher.AEAD
}
CryptoConfig holds encryption configuration
func NewCryptoConfig ¶
func NewCryptoConfig(mode EncryptionMode, keyInput string) (*CryptoConfig, error)
NewCryptoConfig creates a new crypto configuration
type EncryptionMode ¶
type EncryptionMode int
EncryptionMode represents the encryption mode
const ( NoEncryption EncryptionMode = iota AES128 AES256 CHACHA20 )
func ParseEncryptionMode ¶
func ParseEncryptionMode(s string) (EncryptionMode, error)
ParseEncryptionMode parses a string into an EncryptionMode
func (EncryptionMode) String ¶
func (m EncryptionMode) String() string
String returns a string representation of the encryption mode
type MyMsg ¶
type MyMsg struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Type int32 `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"`
Target string `protobuf:"bytes,3,opt,name=target,proto3" json:"target,omitempty"`
Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`
Rproto int32 `protobuf:"zigzag32,5,opt,name=rproto,proto3" json:"rproto,omitempty"`
Magic int32 `protobuf:"zigzag32,6,opt,name=magic,proto3" json:"magic,omitempty"`
Key int32 `protobuf:"zigzag32,7,opt,name=key,proto3" json:"key,omitempty"`
Timeout int32 `protobuf:"varint,8,opt,name=timeout,proto3" json:"timeout,omitempty"`
Tcpmode int32 `protobuf:"varint,9,opt,name=tcpmode,proto3" json:"tcpmode,omitempty"`
TcpmodeBuffersize int32 `protobuf:"varint,10,opt,name=tcpmode_buffersize,json=tcpmodeBuffersize,proto3" json:"tcpmode_buffersize,omitempty"`
TcpmodeMaxwin int32 `protobuf:"varint,11,opt,name=tcpmode_maxwin,json=tcpmodeMaxwin,proto3" json:"tcpmode_maxwin,omitempty"`
TcpmodeResendTimems int32 `protobuf:"varint,12,opt,name=tcpmode_resend_timems,json=tcpmodeResendTimems,proto3" json:"tcpmode_resend_timems,omitempty"`
TcpmodeCompress int32 `protobuf:"varint,13,opt,name=tcpmode_compress,json=tcpmodeCompress,proto3" json:"tcpmode_compress,omitempty"`
TcpmodeStat int32 `protobuf:"varint,14,opt,name=tcpmode_stat,json=tcpmodeStat,proto3" json:"tcpmode_stat,omitempty"`
// contains filtered or unexported fields
}
func (*MyMsg) Descriptor
deprecated
func (*MyMsg) GetTcpmode ¶
func (*MyMsg) GetTcpmodeBuffersize ¶
func (*MyMsg) GetTcpmodeCompress ¶
func (*MyMsg) GetTcpmodeMaxwin ¶
func (*MyMsg) GetTcpmodeResendTimems ¶
func (*MyMsg) GetTcpmodeStat ¶
func (*MyMsg) GetTimeout ¶
func (*MyMsg) ProtoMessage ¶
func (*MyMsg) ProtoMessage()
func (*MyMsg) ProtoReflect ¶
func (x *MyMsg) ProtoReflect() protoreflect.Message
type MyMsg_TYPE ¶
type MyMsg_TYPE int32
const ( MyMsg_DATA MyMsg_TYPE = 0 MyMsg_PING MyMsg_TYPE = 1 MyMsg_KICK MyMsg_TYPE = 2 MyMsg_MAGIC MyMsg_TYPE = 57005 )
func (MyMsg_TYPE) Descriptor ¶
func (MyMsg_TYPE) Descriptor() protoreflect.EnumDescriptor
func (MyMsg_TYPE) Enum ¶
func (x MyMsg_TYPE) Enum() *MyMsg_TYPE
func (MyMsg_TYPE) EnumDescriptor
deprecated
func (MyMsg_TYPE) EnumDescriptor() ([]byte, []int)
Deprecated: Use MyMsg_TYPE.Descriptor instead.
func (MyMsg_TYPE) Number ¶
func (x MyMsg_TYPE) Number() protoreflect.EnumNumber
func (MyMsg_TYPE) String ¶
func (x MyMsg_TYPE) String() string
func (MyMsg_TYPE) Type ¶
func (MyMsg_TYPE) Type() protoreflect.EnumType
type ServerConn ¶
type ServerConn struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.

