Documentation
¶
Index ¶
- Constants
- Variables
- func BeginProxy(remoteConn net.Conn, proxyConn *ProxyConn)
- func GetConnectInfo(b []byte) (addr string, port int)
- func GetNonce(dst []byte)
- type ChaCha20Poly1305
- type Client
- type ConnectInfo
- type Encryptor
- type Packet
- type PacketReceiver
- type PacketSender
- type Proxy
- type ProxyConn
- type Raw
- type Server
- type SizePacket
Constants ¶
View Source
const FAILED = "0"
View Source
const PacketBytes = 2
View Source
const PacketSize = 1<<(PacketBytes*8) - 1
View Source
const SUCCESS = "1"
Variables ¶
View Source
var ErrPrefixNotMacth = errors.New("prefix not match")
View Source
var ErrServerRejected = errors.New("remote server reject connection")
View Source
var ErrVersionDismatch = errors.New("version not match")
View Source
var FailedBytes = []byte(FAILED)
View Source
var SuccessBytes = []byte(SUCCESS)
Functions ¶
func BeginProxy ¶
func GetConnectInfo ¶
Types ¶
type ChaCha20Poly1305 ¶
type ChaCha20Poly1305 struct {
// contains filtered or unexported fields
}
func (*ChaCha20Poly1305) Decrypt ¶
func (c *ChaCha20Poly1305) Decrypt(cipherText []byte, buffer []byte) ([]byte, error)
func (*ChaCha20Poly1305) Encrypt ¶
func (c *ChaCha20Poly1305) Encrypt(plainText []byte, buffer []byte) (b []byte)
func (*ChaCha20Poly1305) Key ¶
func (c *ChaCha20Poly1305) Key(key []byte)
type Client ¶
type ConnectInfo ¶
type ConnectInfo struct {
// contains filtered or unexported fields
}
func (*ConnectInfo) GetConnection ¶
func (ci *ConnectInfo) GetConnection() (addr string, port int)
func (*ConnectInfo) SetConnection ¶
func (ci *ConnectInfo) SetConnection(addr string, port uint16)
func (*ConnectInfo) Size ¶
func (ci *ConnectInfo) Size() (size int)
type Encryptor ¶
type Encryptor interface {
Key([]byte)
Encrypt(plainText []byte, buffer []byte) []byte
Decrypt(cipherText []byte, buffer []byte) ([]byte, error)
}
func GetEncrypt ¶
type Packet ¶
type Packet interface {
PacketSender
PacketReceiver
}
type ProxyConn ¶
type ProxyConn struct {
// contains filtered or unexported fields
}
func CreateProxyConn ¶
type SizePacket ¶
type SizePacket struct {
// contains filtered or unexported fields
}
func (*SizePacket) BodySize ¶
func (p *SizePacket) BodySize() int
func (*SizePacket) Data ¶
func (p *SizePacket) Data() []byte
func (*SizePacket) FullSize ¶
func (p *SizePacket) FullSize() int
Source Files
¶
Click to show internal directories.
Click to hide internal directories.