diff --git a/consul/discovery.go b/consul/discovery.go index 42e4dcb..6cbb5ac 100644 --- a/consul/discovery.go +++ b/consul/discovery.go @@ -61,7 +61,12 @@ func (s *Service) GetID() string { } func (s *Service) GetFullAddr() string { - return fmt.Sprintf("https://%s:%d/", s.domain, s.port) + isTLS := s.port == 443 + proto := "http" + if isTLS { + proto = "https" + } + return fmt.Sprintf("%s://%s:%d/", proto, s.domain, s.port) } func (s *Service) Register() error {