github.com/Asutorufa/yuhaiin@v0.3.6-0.20240502055049-7984da7023a0/pkg/net/proxy/shadowsocksr/protocol/origin.go (about) 1 package protocol 2 3 import "bytes" 4 5 type origin struct{} 6 7 var _origin = &origin{} 8 9 func NewOrigin(Protocol) protocol { return _origin } 10 func (o *origin) EncryptStream(dst *bytes.Buffer, data []byte) (err error) { 11 dst.Write(data) 12 return nil 13 } 14 func (o *origin) DecryptStream(dst *bytes.Buffer, data []byte) (int, error) { return dst.Write(data) } 15 func (o *origin) GetOverhead() int { return 0 } 16 func (a *origin) EncryptPacket(b []byte) ([]byte, error) { return b, nil } 17 func (a *origin) DecryptPacket(b []byte) ([]byte, error) { return b, nil }