diff --git a/tracker/tracker.go b/tracker/tracker.go index ffae4341..b220c292 100644 --- a/tracker/tracker.go +++ b/tracker/tracker.go @@ -45,6 +45,7 @@ type Client interface { Announce(*AnnounceRequest) (AnnounceResponse, error) Connect() error String() string + URL() string } var ( diff --git a/tracker/udp/udp_tracker.go b/tracker/udp/udp_tracker.go index 4ca75da7..94bb1d78 100644 --- a/tracker/udp/udp_tracker.go +++ b/tracker/udp/udp_tracker.go @@ -87,10 +87,14 @@ type client struct { url *url.URL } -func (c *client) String() string { +func (c *client) URL() string { return c.url.String() } +func (c *client) String() string { + return c.URL() +} + func (c *client) Announce(req *tracker.AnnounceRequest) (res tracker.AnnounceResponse, err error) { if !c.connected() { err = tracker.ErrNotConnected