Documentation ¶
Index ¶
- Constants
- Variables
- func ADecrypt(buf []byte) []byte
- func ADecryptString(text string) string
- func AEncrypt(buf []byte) []byte
- func AEncryptString(text string) string
- func Base35Decode(text string) []byte
- func Base35Encode(buf []byte) string
- func DecryptHost(text, mark string) string
- func DecryptRequest(req *http.Request) string
- func EncryptHost(text, mark string) string
- func EncryptRequest(req *http.Request) string
- func NewRand() *rand.Rand
- func RandomKey() string
- func ReverseRandomKey(key string) []byte
- func SafeAddHeader(req *http.Request, k, v string)
- func SafeGetHeader(req *http.Request, k string) string
- func SplitHostPort(host string) (string, string)
- func StartClient(localaddr, upstream string)
- func StartServer(addr string)
- func TwoWayBridge(target, source net.Conn, key string, throttleTargetToSource bool)
- func XorWrite(w http.ResponseWriter, r *http.Request, p []byte, code int) (n int, err error)
- type IOCopyCipher
- type IOReaderCipher
- type InplaceCTR
- type ProxyHttpServer
- type ProxyUpstreamHttpServer
- type TokenBucket
Constants ¶
View Source
const IV_LENGTH = 16
Variables ¶
View Source
var (
OK200 = []byte("HTTP/1.0 200 OK\r\n\r\n")
)
Functions ¶
func ADecryptString ¶
func AEncryptString ¶
func Base35Decode ¶
func Base35Encode ¶
func DecryptHost ¶
func DecryptRequest ¶
func EncryptHost ¶
func EncryptRequest ¶
func ReverseRandomKey ¶
func SafeAddHeader ¶
func SplitHostPort ¶
func StartClient ¶
func StartClient(localaddr, upstream string)
func StartServer ¶
func StartServer(addr string)
func TwoWayBridge ¶
Types ¶
type IOCopyCipher ¶
type IOCopyCipher struct { Dst io.Writer Src io.Reader Key []byte Throttling *TokenBucket Partial bool }
func (*IOCopyCipher) DoCopy ¶
func (cc *IOCopyCipher) DoCopy() (written int64, err error)
type IOReaderCipher ¶
func (*IOReaderCipher) Init ¶
func (rc *IOReaderCipher) Init() *IOReaderCipher
type InplaceCTR ¶
type InplaceCTR struct {
// contains filtered or unexported fields
}
func GetCipherStream ¶
func GetCipherStream(key []byte) *InplaceCTR
func (*InplaceCTR) XorBuffer ¶
func (x *InplaceCTR) XorBuffer(buf []byte)
From src/crypto/cipher/ctr.go
type ProxyHttpServer ¶
func (*ProxyHttpServer) CanDirectConnect ¶
func (proxy *ProxyHttpServer) CanDirectConnect(host string) bool
func (*ProxyHttpServer) ServeHTTP ¶
func (proxy *ProxyHttpServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
type ProxyUpstreamHttpServer ¶
func (*ProxyUpstreamHttpServer) ServeHTTP ¶
func (proxy *ProxyUpstreamHttpServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
type TokenBucket ¶
type TokenBucket struct { Speed int64 // bytes per second // contains filtered or unexported fields }
func NewTokenBucket ¶
func NewTokenBucket(speed, max int64) *TokenBucket
func (*TokenBucket) Consume ¶
func (tb *TokenBucket) Consume(n int64)
Click to show internal directories.
Click to hide internal directories.