mirror of
https://github.com/rclone/rclone.git
synced 2025-04-19 01:59:00 +08: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
|
||||
}
|
||||
|
||||
// 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
|
||||
func (s *Server) UsingAuth() bool {
|
||||
return s.usingAuth
|
||||
|
Loading…
x
Reference in New Issue
Block a user