Documentation
¶
Index ¶
- func BridgeDial(d plugin.BridgeDial) string
- func BridgeServe(b plugin.BridgeServe) string
- func Creds(cs []plugin.UserCred) string
- func Relay(r plugin.RelayForward) string
- func Spec(s plugin.InboundSpec) string
- func State(in []Inbound) string
- func StateBridge(in []Inbound, warp *plugin.WarpSpec, relays []plugin.RelayForward, ...) string
- func StateRelays(in []Inbound, warp *plugin.WarpSpec, relays []plugin.RelayForward) string
- func StateWarp(in []Inbound, warp *plugin.WarpSpec) string
- func Warp(w plugin.WarpSpec) string
- type Inbound
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BridgeDial ¶
func BridgeDial(d plugin.BridgeDial) string
BridgeDial is the hash line of one entry an exit calls: "bridge_dial" + "�" + join("�", entry_node_id, host, port, sni, pin_sha256, path, pool, panel_via, join(",", targets as relay_id:network:port, sorted)).
func BridgeServe ¶
func BridgeServe(b plugin.BridgeServe) string
BridgeServe is the hash line of the entry side of the bridge: "bridge_serve" + "�" + join("�", port, path, join(",", sorted exit_node_ids), panel_via).
func Relay ¶ added in v0.1.65
func Relay(r plugin.RelayForward) string
Relay is the hash line of one forward: "relay" + "\x1f" + join("\x1f", id, network, port, to_host, to_port). It has six fields, so it can never be mistaken for an inbound line (three) or the warp line (two).
A reverse-relay forward (a mode other than "" and "dnat", or an exit_node_id) adds two fields, mode and exit_node_id, so the line of a plain forward is what it was before the bridge existed; a mode of "dnat" counts as "".
func Spec ¶
func Spec(s plugin.InboundSpec) string
Spec hashes the fields listed in agent.proto. settings_json is hashed as the exact bytes received. Tunnel (L3 protocols) is appended only when it is set, so the hash of every spec without one is exactly what it was before Tunnel existed.
func StateBridge ¶
func StateBridge(in []Inbound, warp *plugin.WarpSpec, relays []plugin.RelayForward, serve *plugin.BridgeServe, dials []plugin.BridgeDial) string
StateBridge is StateRelays plus the bridge of the reverse relays: the bridge_serve line (only when serve is set and not empty), then one bridge_dial line per dial, sorted among themselves, after the relay lines. A nil or empty serve and no dials add nothing, so the result is StateRelays(in, warp, relays) byte for byte.
func StateRelays ¶ added in v0.1.65
StateRelays is StateWarp plus the forwarded ports: one Relay line each, sorted among themselves, after the warp line. An empty list adds nothing, so the result is StateWarp(in, warp) byte for byte, and a delta that clears the list and a full state without one hash alike.
func StateWarp ¶
StateWarp is State plus the node-level WARP configuration. With warp == nil the result is State(in) byte for byte; otherwise one extra line "warp" + "\x1f" + Warp(*warp) follows the sorted inbound lines (it is never sorted among them: an inbound line has three fields, this one has two).