core

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2020 License: Apache-2.0 Imports: 6 Imported by: 161

Documentation

Overview

Package core implements essential parts of Shadowsocks

Index

Constants

This section is empty.

Variables

View Source
var ErrCipherNotSupported = errors.New("cipher not supported")

ErrCipherNotSupported occurs when a cipher is not supported (likely because of security concerns).

Functions

func Dial

func Dial(network, address string, ciph StreamConnCipher) (net.Conn, error)

func ListCipher

func ListCipher() []string

ListCipher returns a list of available cipher names sorted alphabetically.

func Listen

func Listen(network, address string, ciph StreamConnCipher) (net.Listener, error)

func ListenPacket

func ListenPacket(network, address string, ciph PacketConnCipher) (net.PacketConn, error)

Types

type Cipher

type Cipher interface {
	StreamConnCipher
	PacketConnCipher
}

func PickCipher

func PickCipher(name string, key []byte, password string) (Cipher, error)

PickCipher returns a Cipher of the given name. Derive key from password if given key is empty.

type PacketConnCipher

type PacketConnCipher interface {
	PacketConn(net.PacketConn) net.PacketConn
}

type StreamConnCipher

type StreamConnCipher interface {
	StreamConn(net.Conn) net.Conn
}

Jump to

Keyboard shortcuts

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