Documentation ¶
Index ¶
- Constants
- Variables
- func GenChacha20Key() ([]byte, error)
- func Join(c1 io.ReadWriteCloser, c2 io.ReadWriteCloser) (inCount int64, outCount int64)
- func KeyByteToString(key []byte) string
- func KeyStringToByte(key string) ([]byte, error)
- func WriteKeyToFile(keyPath string, clientID string, key string) error
- type Chacha20Stream
- type EncryptProtocl
- type HandshakeReq
- type UDPpacket
- type VeilConn
- type VeilinkProtocol
Constants ¶
View Source
const DefaultKeyPath = "./key"
Variables ¶
Functions ¶
func GenChacha20Key ¶
func Join ¶
func Join(c1 io.ReadWriteCloser, c2 io.ReadWriteCloser) (inCount int64, outCount int64)
Join two connections together and return the number of bytes transferred
func KeyByteToString ¶
func KeyStringToByte ¶
Types ¶
type Chacha20Stream ¶
type Chacha20Stream struct {
// contains filtered or unexported fields
}
func NewChacha20Stream ¶
func NewChacha20Stream(key []byte, conn VeilConn) (*Chacha20Stream, error)
func (*Chacha20Stream) Close ¶
func (s *Chacha20Stream) Close() error
func (*Chacha20Stream) SetWriteDeadline ¶
func (s *Chacha20Stream) SetWriteDeadline(t time.Time) error
type EncryptProtocl ¶
type EncryptProtocl []byte
func (EncryptProtocl) Encode ¶
func (ep EncryptProtocl) Encode(envOn bool) []byte
type HandshakeReq ¶
type HandshakeReq struct {
ClientID string
}
func (*HandshakeReq) Encode ¶
func (req *HandshakeReq) Encode() ([]byte, error)
type VeilinkProtocol ¶
type VeilinkProtocol struct { ClientID string // 客户端ID PublicProtocol string // 外网协议 PublicIP string // 外网IP PublicPort uint16 // 外网端口 InternalProtocol string // 内网协议 InternalIP string // 内网IP InternalPort uint16 // 内网端口 }
VeilinkProtocol Veilink协议
func (*VeilinkProtocol) Encode ¶
func (vp *VeilinkProtocol) Encode() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.