Documentation
¶
Overview ¶
Package mieru provides Sing2's Mieru inbound — a drop-in replacement for the base fork's, adding the hot user updates the base cannot do (doc/13 T6). See inbound.go for why it exists.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewInbound ¶
func RegisterInbound ¶
RegisterInbound installs Sing2's Mieru inbound, replacing whatever is already registered for C.TypeMieru. Call it on the registry AFTER include.InboundRegistry().
Types ¶
type AuthStats ¶ added in v0.0.4
type AuthStats struct {
// Direct is the cheap path: an established session whose cipher is already
// bound to a user. No search involved.
Direct int64
FailedDirect int64
// HintMatch counts decrypt attempts against users the nonce hint narrowed
// down to — normally exactly one. Failed ones are hint collisions (the hint
// is 4 bytes) or junk that happened to collide.
HintMatch int64
FailedHintMatch int64
// Iterate counts full try-every-user sweeps. THIS is the expensive path.
// FailedIterate is the subset that matched nobody, i.e. pure waste — the
// clearest signal that a node is being made to burn CPU on traffic that
// could never authenticate.
Iterate int64
FailedIterate int64
}
AuthStats is a snapshot of mieru's server-side decryption counters.
func ReadAuthStats ¶ added in v0.0.4
func ReadAuthStats() AuthStats
ReadAuthStats snapshots the counters. Cheap — six atomic loads.
func (AuthStats) IsZero ¶ added in v0.0.4
IsZero reports whether nothing at all happened in this window.
type Inbound ¶
Inbound is a Mieru server inbound backed directly by mieru's protocol.Mux.
func (*Inbound) UpdateUsers ¶
UpdateUsers replaces the authoritative user set on the RUNNING server.
This is the whole point of the package: established connections keep working (mieru leaves existing TCPUnderlays and Sessions alone), new handshakes immediately see the new set, and removed users can no longer authenticate. Before Start it just records the set, which Start then installs.
It is also where a node that started with zero users finally comes up — see the deferred-start comment in Start.