Documentation
¶
Overview ¶
Package apis exposes the Sudoku appearance codec as a small raw-stream API.
The returned connections read and write the caller's original bytes while the underlying wire stream is encoded with the Sudoku byte layout. This package intentionally does not provide HTTP masking, encryption, handshakes, UoT, or reverse proxy helpers.
Index ¶
- Constants
- func BuildTables(cfg *Config) ([]*sudoku.Table, error)
- func ClientConn(raw net.Conn, cfg *Config) (net.Conn, error)
- func HandleMuxServer(conn net.Conn, onConnect func(targetAddr string)) error
- func HandleMuxWithDialer(conn net.Conn, onConnect func(targetAddr string), ...) error
- func ServerConn(raw net.Conn, cfg *Config) (net.Conn, error)
- func WrapConn(raw net.Conn, cfg *Config, side Side) (net.Conn, error)
- type Config
- type MuxClient
- type Side
Constants ¶
const ( // DefaultKey is a deterministic shared key for the appearance table. // Override it when the client and server should use a private table. DefaultKey = "2d8f2c94-3fd0-4a57-8d18-61f33aee2c44" // DefaultASCII is the default Sudoku byte layout preference. DefaultASCII = "prefer_entropy" )
Variables ¶
This section is empty.
Functions ¶
func BuildTables ¶ added in v0.4.8
BuildTables builds every configured table candidate.
func ClientConn ¶ added in v0.4.8
ClientConn wraps the client side of a raw connection.
func HandleMuxServer ¶
HandleMuxServer runs a target-address mux server over an already-wrapped raw Sudoku appearance connection.
func HandleMuxWithDialer ¶
func HandleMuxWithDialer(conn net.Conn, onConnect func(targetAddr string), dialTarget func(targetAddr string) (net.Conn, error)) error
HandleMuxWithDialer is like HandleMuxServer but lets the caller control how target addresses are opened.
func ServerConn ¶ added in v0.4.8
ServerConn wraps the server side of a raw connection.
Types ¶
type Config ¶ added in v0.4.8
type Config struct {
// Key seeds the Sudoku table. Both sides must use the same key.
Key string
// ASCII selects the byte layout: "prefer_entropy", "prefer_ascii", or a
// directional value such as "up_ascii_down_entropy".
ASCII string
// CustomTables contains optional X/P/V byte-layout patterns.
// With no handshake in this raw codec API, both sides must use the same TableIndex.
CustomTables []string
// TableIndex selects which configured table to use. The default table is index 0.
TableIndex int
// EnablePureDownlink keeps server-to-client traffic in classic Sudoku mode.
// The default is false, which uses packed downlink.
EnablePureDownlink bool
// PaddingMin and PaddingMax are optional padding probabilities in percent.
PaddingMin int
PaddingMax int
}
Config describes only the Sudoku appearance layer.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns the default raw Sudoku appearance config.
func Normalize ¶ added in v0.4.8
Normalize returns a copy of cfg with defaults and canonical mode names applied.
func (*Config) BuildTables ¶ added in v0.4.8
BuildTables builds every configured table candidate.
type MuxClient ¶
type MuxClient struct {
// contains filtered or unexported fields
}
MuxClient opens multiple logical target streams over one already-wrapped raw Sudoku appearance connection. It has no HTTPMask dependency.
func NewMuxClient ¶
NewMuxClient starts a mux session over conn.