package
module
Version:
v1.2.0
Opens a new window with list of versions in this module.
Published: Apr 6, 2021
License: MIT
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
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:
- Dial to a remote port and forward all traffic.
- Serve in incoming traffic using SOCKS5 protocol.
Documentation
¶
-
func ClientConn(conn net.Conn, local *x25519.PrivateKey, peer []byte) (net.Conn, error)
-
func ServerConn(conn net.Conn, local *x25519.PrivateKey) (net.Conn, error)
-
func WrapConn(conn net.Conn, salt, sharedKey, nonceEgress, nonceIngress []byte) (net.Conn, error)
ClientConn wraps an outgoing connection to the server: handshake and encrypt all traffic
ServerConn wraps an incoming connection from the client: handshake and encrypt all traffic
WrapConn wraps a net.Conn so that Read() decrypts the payload and Write() encrypts the payload.
Source Files
¶
Directories
¶
cmd
|
|
|
|
|
|
|
|
|
|
Click to show internal directories.
Click to hide internal directories.