Documentation
¶
Overview ¶
Package dnsserver implements an embeddable iroh DNS and pkarr relay server.
The Go API is not stable before v1 and may change in any v0 release.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server stores pkarr relay payloads in memory and serves them over HTTP and DNS. It is safe for concurrent use.
The store holds at most 10,000 records and drops a record 7 days after it was last stored. Storing a record first drops expired records and then, if the store is full, the record stored least recently; storing a newer packet for a key replaces the old one and counts as storing it again. The cap is global, not per publisher: anyone who can PUT 10,000 fresh keys within the retention window displaces every other record, and those records stay gone until their owners publish again. Deployments facing untrusted publishers should rate limit PUTs in front of the server.
func (*Server) ServeDNSPacket ¶
ServeDNSPacket handles one DNS wire-format message and returns a DNS wire-format response.
func (*Server) ServeHTTP ¶
func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP handles PUT and GET of pkarr relay payloads at /pkarr/<key> or /<key>.
func (*Server) ServePacketConn ¶
ServePacketConn serves DNS messages on pc until ctx is canceled or pc returns a non-close read error.