dnsserver

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

func New

func New() *Server

New returns an empty DNS server.

func (*Server) ServeDNSPacket

func (s *Server) ServeDNSPacket(msg []byte) ([]byte, error)

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

func (s *Server) ServePacketConn(ctx context.Context, pc net.PacketConn) error

ServePacketConn serves DNS messages on pc until ctx is canceled or pc returns a non-close read error.

func (*Server) Snapshot

func (s *Server) Snapshot() metrics.Snapshot

Snapshot returns the server's counter snapshot for metrics.Registry.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL