Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultKCPConfig is the default KCP config. DefaultConfig = &Config{ Key: "it's a secrect", Crypt: "aes", Mode: "fast", MTU: 1350, SndWnd: 1024, RcvWnd: 1024, DataShard: 10, ParityShard: 3, DSCP: 0, NoComp: false, AckNodelay: false, NoDelay: 0, Interval: 50, Resend: 0, NoCongestion: 0, SockBuf: 4194304, SmuxVer: 1, SmuxBuf: 4194304, StreamBuf: 2097152, KeepAlive: 10, SnmpLog: "", SnmpPeriod: 60, Signal: false, TCP: false, } )
View Source
var (
// DefaultSalt is the default salt for KCP cipher.
DefaultSalt = "kcp-go"
)
Functions ¶
func BlockCrypt ¶
func BlockCrypt(key, crypt, salt string) (block kcp.BlockCrypt)
Types ¶
type Config ¶
type Config struct { Key string `json:"key"` Crypt string `json:"crypt"` Mode string `json:"mode"` MTU int `json:"mtu"` SndWnd int `json:"sndwnd"` RcvWnd int `json:"rcvwnd"` DataShard int `json:"datashard"` ParityShard int `json:"parityshard"` DSCP int `json:"dscp"` NoComp bool `json:"nocomp"` AckNodelay bool `json:"acknodelay"` NoDelay int `json:"nodelay"` Interval int `json:"interval"` Resend int `json:"resend"` NoCongestion int `json:"nc"` SockBuf int `json:"sockbuf"` SmuxBuf int `json:"smuxbuf"` StreamBuf int `json:"streambuf"` SmuxVer int `json:"smuxver"` KeepAlive int `json:"keepalive"` SnmpLog string `json:"snmplog"` SnmpPeriod int `json:"snmpperiod"` Signal bool `json:"signal"` // Signal enables the signal SIGUSR1 feature. TCP bool `json:"tcp"` }
KCPConfig describes the config for KCP.
func ParseFromFile ¶
Click to show internal directories.
Click to hide internal directories.