Movatterモバイル変換


[0]ホーム

URL:


overlay

package
v0.4.1Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License:CC0-1.0Imports:32Imported by:0

Details

Repository

github.com/coder/wush

Links

Documentation

Index

Constants

View Source
const (RtcMetadataTypeFileMetadata = "file_metadata"RtcMetadataTypeFileComplete = "file_complete"RtcMetadataTypeFileAck      = "file_ack")

Variables

View Source
var TailscaleServicePrefix6 = [6]byte{0xfd, 0x7a, 0x11, 0x5c, 0xa1, 0xe0}

Functions

This section is empty.

Types

typeClientAuth

type ClientAuth struct {Webbool// OverlayPrivateKey is the main auth mechanism used to secure the overlay.// Peers are sent this private key to encrypt node communication to the// receiver. Leaking this private key would allow anyone to connect.OverlayPrivateKeykey.NodePrivate// ReceiverPublicKey is the public key of the receiver. Node messages are// encrypted to this public key.ReceiverPublicKeykey.NodePublic// ReceiverStunAddr is the address that the receiver is reachable over UDP// when the overlay is running in P2P mode.ReceiverStunAddrnetip.AddrPort// ReceiverDERPRegionID is the region id that the receiver is reachable over// DERP when the overlay is running in DERP mode.ReceiverDERPRegionIDuint16}

func (*ClientAuth)AuthKey

func (ca *ClientAuth) AuthKey()string

func (*ClientAuth)Parse

func (ca *ClientAuth) Parse(authKeystring)error

func (*ClientAuth)PrintDebugadded inv0.0.6

func (ca *ClientAuth) PrintDebug(logf func(strstring, args ...any), dm *tailcfg.DERPMap)

typeHostInfoadded inv0.1.1

type HostInfo struct {UsernamestringHostnamestring}

typeLogfadded inv0.2.0

type Logf func(formatstring, args ...any)

typeOverlay

type Overlay interface {// listenOverlay(ctx context.Context, kind string) errorRecv() <-chan *tailcfg.NodeSendTailscaleNodeUpdate(node *tailcfg.Node)IPs() []netip.Addr}

Overlay specifies the mechanism by which senders and receivers exchangeTailscale nodes over a sidechannel.

typeReceive

type Receive struct {Logger    *slog.LoggerHumanLogfLogfDerpMap   *tailcfg.DERPMap// SelfPriv is the private key that peers will encrypt overlay messages to.// The public key of this is sent in the auth key.SelfPrivkey.NodePrivate// PeerPriv is the main auth mechanism used to secure the overlay. Peers are// sent this private key to encrypt node communication. Leaking this private// key would allow anyone to connect.PeerPrivkey.NodePrivate// contains filtered or unexported fields}

funcNewReceiveOverlay

func NewReceiveOverlay(logger *slog.Logger, hlogLogf, dm *tailcfg.DERPMap) *Receive

func (*Receive)ClientAuth

func (r *Receive) ClientAuth() *ClientAuth

func (*Receive)IPsadded inv0.4.0

func (r *Receive) IPs() []netip.Addr

func (*Receive)ListenOverlayDERP

func (r *Receive) ListenOverlayDERP(ctxcontext.Context)error

func (*Receive)ListenOverlaySTUN

func (r *Receive) ListenOverlaySTUN(ctxcontext.Context) (<-chan struct{},error)

func (*Receive)PickDERPHome

func (r *Receive) PickDERPHome(ctxcontext.Context)error

func (*Receive)Recv

func (r *Receive) Recv() <-chan *tailcfg.Node

func (*Receive)SendTailscaleNodeUpdateadded inv0.4.0

func (r *Receive) SendTailscaleNodeUpdate(node *tailcfg.Node)

typeRtcFileMetadataadded inv0.4.0

type RtcFileMetadata struct {FileNamestring `json:"fileName"`FileSizeint    `json:"fileSize"`}

typeRtcMetadataadded inv0.4.0

type RtcMetadata struct {Typestring          `json:"type"`FileMetadataRtcFileMetadata `json:"fileMetadata"`}

typeSend

type Send struct {Logger         *slog.LoggerSTUNIPOverridenetip.AddrSelfIPnetip.AddrAuthClientAuthRtcConn *webrtc.PeerConnectionRtcDc   *webrtc.DataChannelWaitTransferDone chan struct{}// contains filtered or unexported fields}

funcNewSendOverlay

func NewSendOverlay(logger *slog.Logger, dm *tailcfg.DERPMap) *Send

func (*Send)IPsadded inv0.4.0

func (s *Send) IPs() []netip.Addr

func (*Send)ListenOverlayDERP

func (s *Send) ListenOverlayDERP(ctxcontext.Context)error

func (*Send)ListenOverlaySTUN

func (s *Send) ListenOverlaySTUN(ctxcontext.Context)error

func (*Send)Recv

func (s *Send) Recv() <-chan *tailcfg.Node

func (*Send)SendTailscaleNodeUpdateadded inv0.4.0

func (s *Send) SendTailscaleNodeUpdate(node *tailcfg.Node)

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp