utils

package
v0.0.0-...-a4e0618 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AptyDomainName = byte('\x03')
View Source
var AptyIPV4 = byte('\x01')

ATYP

View Source
var AptyIPV6 = byte('\x04')
View Source
var AuthNo = byte('\x00')

auth

View Source
var AuthUsernamePassword = byte('\x02')
View Source
var CmdConnect = byte('\x01')

command

View Source
var NoAcceptableMethods = byte('\xFF')
View Source
var Pool32K = &bufferPool{freeList: make(chan []byte, 100), size: 32 * 1024}
View Source
var Pool33K = &bufferPool{freeList: make(chan []byte, 100), size: 33 * 1024}
View Source
var ReplySuccess = byte('\x00')
View Source
var Rsv = byte('\x00')
View Source
var Version = byte('\x05')

global

Functions

func Copy

func Copy(dst net.Conn, src net.Conn) (written int64, err error)

func StartAccepter

func StartAccepter(addr string, connectionsPoolSize int) (connections chan net.Conn)

Types

type EncryptedConn

type EncryptedConn struct {
	net.Conn
	Encryptor *Encryptor
}

EncryptedConn is a sort of encrypted connection between socccks-client and socccks-server

func NewEncryptedConn

func NewEncryptedConn(conn net.Conn, password string) *EncryptedConn

func (*EncryptedConn) Read

func (ec *EncryptedConn) Read(buf []byte) (rn int, err error)

read Encrypted data, fill buf with plainText

func (*EncryptedConn) Write

func (ec *EncryptedConn) Write(rawData []byte) (nw int, err error)

encrypt plainText, then write them to the socket

type Encryptor

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

func NewEncryptor

func NewEncryptor(rawKey string) *Encryptor

func (*Encryptor) CFBDecrypter

func (e *Encryptor) CFBDecrypter(ciphertext []byte, buf []byte) int

func (*Encryptor) CFBEncrypter

func (e *Encryptor) CFBEncrypter(plaintext []byte, buf []byte) int

Jump to

Keyboard shortcuts

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