shadowsocksr

package module
v0.0.0-...-b0d026c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2020 License: MIT Imports: 28 Imported by: 0

README

shadowsocksR

shadowsocksR is a shadowsocksR for Go library

  • shadowsocksR is based on avege and shadowsocksR for Python changes.
  • Repair avege SSR communication BUG and streamline version. Is a normal use version.
Use
bi := &BackendInfo{
	Address: "www.domain.com:445",
	Type:    "ssr",
	SSInfo: SSInfo{
		EncryptMethod:   "aes-128-cfb",
		EncryptPassword: "password",
		SSRInfo: SSRInfo{
			Protocol:      "auth_aes128_sha1",
			ProtocolParam: "",
			Obfs:          "tls1.2_ticket_auth",
			ObfsParam:     "",
		},
	},
}
dst, err := bi.DialSSRConn(rawaddr)
bi.Pipe(src, dst)
bi.Pipe(dst, src)

See 'example/client.go' for detailed usage.

SS Encrypting algorithm
  • aes-128-cfb
  • aes-192-cfb
  • aes-256-cfb
  • aes-128-ctr
  • aes-192-ctr
  • aes-256-ctr
  • aes-128-ofb
  • aes-192-ofb
  • aes-256-ofb
  • des-cfb
  • bf-cfb
  • cast5-cfb
  • rc4-md5
  • chacha20
  • chacha20-ietf
  • salsa20
  • camellia-128-cfb
  • camellia-192-cfb
  • camellia-256-cfb
  • idea-cfb
  • rc2-cfb
  • seed-cfb
SSR Obfs
  • plain
  • http_simple
  • http_post
  • random_head
  • tls1.2_ticket_auth
SSR Protocol
  • origin
  • verify_sha1 aka. one time auth(OTA)
  • auth_sha1_v4
  • auth_aes128_md5
  • auth_aes128_sha1

Todo (help wanted)

  • Optimize performance
Thanks avege project
Reference

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckCipherMethod

func CheckCipherMethod(method string) error

Types

type DecOrEnc

type DecOrEnc int
const (
	Decrypt DecOrEnc = iota
	Encrypt
)

type SSTCPConn

type SSTCPConn struct {
	net.Conn
	sync.RWMutex
	*StreamCipher
	IObfs     obfs.IObfs
	IProtocol protocol.IProtocol
	// contains filtered or unexported fields
}

SSTCPConn the struct that override the net.Conn methods

func NewSSRClient

func NewSSRClient(u *url.URL) (*SSTCPConn, error)

func NewSSTCPConn

func NewSSTCPConn(c net.Conn, cipher *StreamCipher) *SSTCPConn

func (*SSTCPConn) Close

func (c *SSTCPConn) Close() error

func (*SSTCPConn) GetIv

func (c *SSTCPConn) GetIv() (iv []byte)

func (*SSTCPConn) GetKey

func (c *SSTCPConn) GetKey() (key []byte)

func (*SSTCPConn) Read

func (c *SSTCPConn) Read(b []byte) (n int, err error)

func (*SSTCPConn) Write

func (c *SSTCPConn) Write(b []byte) (n int, err error)

type StreamCipher

type StreamCipher struct {
	// contains filtered or unexported fields
}

func NewStreamCipher

func NewStreamCipher(method, password string) (c *StreamCipher, err error)

NewStreamCipher creates a cipher that can be used in Dial() etc. Use cipher.Copy() to create a new cipher with the same method and password to avoid the cost of repeated cipher initialization.

func (*StreamCipher) Copy

func (c *StreamCipher) Copy() *StreamCipher

Copy creates a new cipher at it's initial state.

func (*StreamCipher) IV

func (c *StreamCipher) IV() ([]byte, int)

func (*StreamCipher) Key

func (c *StreamCipher) Key() (key []byte, keyLen int)

Directories

Path Synopsis
leakybuf
Provides leaky buffer, based on the example in Effective Go.
Provides leaky buffer, based on the example in Effective Go.
socks
Package socks implements essential parts of SOCKS protocol.
Package socks implements essential parts of SOCKS protocol.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL