relay

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DialViaRelay

func DialViaRelay(ctx context.Context, t *transport.Transport, relayAddr, targetNodeID string) (*quic.Stream, error)

DialViaRelay opens a relayed connection to a target node through a relay node. The relay node must be running a relay.Server.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server relays traffic between NATed peers that can't reach each other directly. It runs on nodes with public IPs.

func NewServer

func NewServer(t *transport.Transport, logger *log.Logger) *Server

NewServer creates a relay server and registers the relay stream handler on the given transport.

type StreamConn

type StreamConn struct {
	Stream      *quic.Stream
	LocalAddr_  net.Addr
	RemoteAddr_ net.Addr
}

StreamConn wraps a QUIC stream as a net.Conn for use with memberlist or other code expecting a standard connection interface.

func (*StreamConn) Close

func (c *StreamConn) Close() error

func (*StreamConn) LocalAddr

func (c *StreamConn) LocalAddr() net.Addr

func (*StreamConn) Read

func (c *StreamConn) Read(b []byte) (int, error)

func (*StreamConn) RemoteAddr

func (c *StreamConn) RemoteAddr() net.Addr

func (*StreamConn) SetDeadline

func (c *StreamConn) SetDeadline(t time.Time) error

func (*StreamConn) SetReadDeadline

func (c *StreamConn) SetReadDeadline(t time.Time) error

func (*StreamConn) SetWriteDeadline

func (c *StreamConn) SetWriteDeadline(t time.Time) error

func (*StreamConn) Write

func (c *StreamConn) Write(b []byte) (int, error)

Jump to

Keyboard shortcuts

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