socks

package module
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: GPL-3.0 Imports: 17 Imported by: 0

README

quic-socks

quic-socks implements socks5 server using custom protocol in the back end, due to the use of QUIC , 2x faster than shadowsocks+TCP BBR, and safer.

Features

  • implements socks5 server in the front end for less RTT
  • using custom protocol in the back end(client <-> server), only need 1 RTT
  • client <-> server using TLS 1.3(QUIC), less RTT
  • due to use of QUIC(UDP), implements BBR in user state
  • the experience is still good in the case of weak networks
  • the experience will not deteriorate in the case of mobile networks
  • using pre-connection to reduce RTT between client and server

Protocol

password + type + host + port
see protocol.go

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConnClosed = errors.New("connection closed")

ErrConnClosed is an error about closed

Functions

func Connect

func Connect(conn net.Conn, host string, port uint16) (net.Conn, error)

func GenDefaultHtml added in v1.0.3

func GenDefaultHtml(remoteAddrStr string) string

func GenDefaultHttpHeader added in v1.0.3

func GenDefaultHttpHeader(contentLength int) string

func GenDefaultHttpResponse added in v1.0.3

func GenDefaultHttpResponse(remoteAddrStr string) string

Types

type Client

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

func NewClient

func NewClient(address string, password []byte, tlsConfig *tls.Config) (*Client, error)

func (*Client) Dial

func (c *Client) Dial() (net.Conn, error)

type Conn

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

Conn implement net.Conn

func (*Conn) Close

func (c *Conn) Close() error

Close is used to close connection

func (*Conn) LocalAddr

func (c *Conn) LocalAddr() net.Addr

LocalAddr is used to get local address

func (*Conn) Read

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

Read reads data from the connection

func (*Conn) RemoteAddr

func (c *Conn) RemoteAddr() net.Addr

RemoteAddr is used to get remote address

func (*Conn) SetDeadline

func (c *Conn) SetDeadline(t time.Time) error

SetDeadline is used to set read and write deadline

func (*Conn) SetReadDeadline

func (c *Conn) SetReadDeadline(t time.Time) error

SetReadDeadline is used to set read deadline

func (*Conn) SetWriteDeadline

func (c *Conn) SetWriteDeadline(t time.Time) error

SetWriteDeadline is used to set write deadline

func (*Conn) Write

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

Write writes data to the connection

type Response

type Response uint8

func (Response) Error

func (r Response) Error() string

type Server

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

func NewServer

func NewServer(address string, password []byte, tlsConfig *tls.Config) (*Server, error)

func (*Server) Close

func (s *Server) Close()

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

Jump to

Keyboard shortcuts

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