simplesocks

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: MIT Imports: 6 Imported by: 0

README

Simple SOCKS

Be young and be simple.

Protocol

The client and server use X25519 for key exchange and ChaCha20 for encryption. See conn.go for the protocol.

A reference client is implemented in cmd/ss-client.

  • Generate an ephemeral key.
  • Listen on a local port.
  • Dial to the server.
  • Perform key exchange.
  • Encrypt all traffic from local port and forward to the server.

A reference server is implemented in cmd/ss-server.

  • Load a key from file or generates an ephemeral key.
  • Listen on a local port.
  • Perform key exchange.
  • Decrypt incoming traffic, and depending on the operating mode:
    1. Dial to a remote port and forward all traffic.
    2. Serve in incoming traffic using SOCKS5 protocol.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientConn

func ClientConn(conn net.Conn, local *x25519.PrivateKey, peer []byte) (net.Conn, error)

ClientConn wraps an outgoing connection to the server: handshake and encrypt all traffic

func ServerConn

func ServerConn(conn net.Conn, local *x25519.PrivateKey) (net.Conn, error)

ServerConn wraps an incoming connection from the client: handshake and encrypt all traffic

func WrapConn

func WrapConn(conn net.Conn, salt, sharedKey, nonceEgress, nonceIngress []byte) (net.Conn, error)

WrapConn wraps a net.Conn so that Read() decrypts the payload and Write() encrypts the payload.

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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