Documentation ¶
Overview ¶
Package tracker gets peers from (HTTP/S and UDP) tracker servers.
Tracker servers are typically the primary method of peer discovery.
Basic Usage ¶
The Tracker URL string can represent either a HTTP/S or UDP tracker address. tracker.GetPeers() will handle HTTP/S and UDP URLs separately.
// http peerAddrs, err := tracker.GetPeers("http://academictorrents.com/announce.php") // udp peerAddrs, err := tracker.GetPeers("udp://tracker.opentrackr.org:1337/announce")
The UDP Client implementation is exported as well, but does not need to be used in most use cases.
Index ¶
Constants ¶
View Source
const ( ConnectAction udpMessageAction = iota AnnounceAction ScrapeAction ErrorAction )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type UDPClient ¶
type UDPClient struct {
// contains filtered or unexported fields
}
UDPClient is an implementation of BEP0015 to locate peers without DHT. http://bittorrent.org/beps/bep_0015.html
func NewUDPClient ¶
NewUDPClient generates a client to a UDP Tracker server per BEP0015.
Click to show internal directories.
Click to hide internal directories.