mirror of
https://github.com/rclone/rclone.git
synced 2025-06-25 14:31:39 +02:00
lib/http: add Addr() method to return the first configured server address
This commit is contained in:
parent
efe8ac8f35
commit
90ea4a73ad
@ -576,6 +576,14 @@ func (s *Server) URLs() []string {
|
|||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Addr returns the first configured address
|
||||||
|
func (s *Server) Addr() net.Addr {
|
||||||
|
if len(s.instances) == 0 || s.instances[0].listener == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return s.instances[0].listener.Addr()
|
||||||
|
}
|
||||||
|
|
||||||
// UsingAuth returns true if authentication is required
|
// UsingAuth returns true if authentication is required
|
||||||
func (s *Server) UsingAuth() bool {
|
func (s *Server) UsingAuth() bool {
|
||||||
return s.usingAuth
|
return s.usingAuth
|
||||||
|
Loading…
x
Reference in New Issue
Block a user