bep14

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: MIT Imports: 17 Imported by: 0

README

BitTorrent Local Service Discovery

A bep14 implement in golang.

Documentation

Overview

Example
c := New(6007, EnableV6(), EnableV4())

var g sync.WaitGroup

g.Add(1)
go func() {
	defer g.Done()
	c.Start()
}()

g.Add(1)
go func() {
	defer g.Done()
	for ih := range c.C {
		fmt.Println(ih)
	}
}()

c.Announce([]string{"88e17659cc7f6b94d8c844d02413471253c1bf49"})

g.Wait()
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnableV4

func EnableV4() option

func EnableV6

func EnableV6() option

Types

type Announce

type Announce struct {
	InfoHashes []string
	Source     netip.AddrPort
}

type LSP

type LSP struct {
	C <-chan Announce // exposed API
	// contains filtered or unexported fields
}

func New

func New(clientPort uint16, options ...option) *LSP

func (*LSP) Announce

func (l *LSP) Announce(infoHashes []string) error

func (*LSP) Start

func (l *LSP) Start()

Jump to

Keyboard shortcuts

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