lib

package
v0.0.0-...-ec37276 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConnTimeout = 10 * time.Second

	MsgPing  = 0x01
	MsgPong  = 0x02
	MsgProxy = 0x03

	AnnounceAddr     = "https://discovery-v6.syncthing.net/v2/?nolookup&id=LYXKCHX-VI3NYZR-ALCJBHF-WMZYSPK-QG6QJA3-MPFYMSO-U56GTUK-NA2MIAW"
	LookupAddr       = "https://discovery.syncthing.net/v2/?noannounce&id=LYXKCHX-VI3NYZR-ALCJBHF-WMZYSPK-QG6QJA3-MPFYMSO-U56GTUK-NA2MIAW"
	DynamicRelayAddr = "dynamic+https://relays.syncthing.net/endpoint"
)

Variables

This section is empty.

Functions

func Connect

func Connect(logger *log.Logger, ctx context.Context, clientName string, deviceID protocol.DeviceID, addr string) (*tls.Conn, error)

func LookupAndConnect

func LookupAndConnect(logger *log.Logger, ctx context.Context, clientName string, deviceID protocol.DeviceID) (*tls.Conn, error)

func LookupDevice

func LookupDevice(ctx context.Context, deviceID protocol.DeviceID) (string, error)

func PerformHandshakeAndValidation

func PerformHandshakeAndValidation(conn *tls.Conn, deviceID protocol.DeviceID) error

func Ping

func Ping(logger *log.Logger, conn *tls.Conn) error

func Proxy

func Proxy(sconn *tls.Conn) (net.Conn, error)

func TlsConfig

func TlsConfig(cert tls.Certificate) *tls.Config

Types

type Server

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

func NewServer

func NewServer(logger *log.Logger, ctx context.Context, config *ServerConfig) (*Server, error)

func (*Server) AddressLister

func (server *Server) AddressLister() discover.AddressLister

func (*Server) ServeDiscover

func (server *Server) ServeDiscover() error

func (*Server) ServeServer

func (server *Server) ServeServer() error

type ServerConfig

type ServerConfig struct {
	Cert          tls.Certificate
	ServerNetwork string
	ServerAddress string
}

Jump to

Keyboard shortcuts

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