Feature: add ssr support (#805)
* Refactor ssr stream cipher to expose iv and key References: https://github.com/Dreamacro/go-shadowsocks2 https://github.com/sh4d0wfiend/go-shadowsocksr2 * Implement ssr obfs Reference: https://github.com/mzz2017/shadowsocksR * Implement ssr protocol References: https://github.com/mzz2017/shadowsocksR https://github.com/shadowsocksRb/shadowsocksr-libev https://github.com/shadowsocksr-backup/shadowsocksr
This commit is contained in:
36
component/ssr/protocol/origin.go
Normal file
36
component/ssr/protocol/origin.go
Normal file
@ -0,0 +1,36 @@
|
||||
package protocol
|
||||
|
||||
type origin struct{ *Base }
|
||||
|
||||
func init() {
|
||||
register("origin", newOrigin)
|
||||
}
|
||||
|
||||
func newOrigin(b *Base) Protocol {
|
||||
return &origin{}
|
||||
}
|
||||
|
||||
func (o *origin) initForConn(iv []byte) Protocol { return &origin{} }
|
||||
|
||||
func (o *origin) GetProtocolOverhead() int {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (o *origin) SetOverhead(overhead int) {
|
||||
}
|
||||
|
||||
func (o *origin) Decode(b []byte) ([]byte, int, error) {
|
||||
return b, len(b), nil
|
||||
}
|
||||
|
||||
func (o *origin) Encode(b []byte) ([]byte, error) {
|
||||
return b, nil
|
||||
}
|
||||
|
||||
func (o *origin) DecodePacket(b []byte) ([]byte, int, error) {
|
||||
return b, len(b), nil
|
||||
}
|
||||
|
||||
func (o *origin) EncodePacket(b []byte) ([]byte, error) {
|
||||
return b, nil
|
||||
}
|
Reference in New Issue
Block a user