From 1d8a6ccbb639470d88cc56f0cfb46c331d23440f Mon Sep 17 00:00:00 2001 From: Matthew Dolan Date: Thu, 19 Oct 2017 09:27:07 -0700 Subject: [PATCH] Add scheme to the url (http or https) and allow http for http schemes. (#118) --- http_collector_client.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/http_collector_client.go b/http_collector_client.go index a7f9ddf3c..08e0d375b 100644 --- a/http_collector_client.go +++ b/http_collector_client.go @@ -57,7 +57,7 @@ func newHttpCollectorClient( reporterID uint64, attributes map[string]string, ) (*httpCollectorClient, error) { - url, err := url.Parse(opts.Collector.HostPort()) + url, err := url.Parse(opts.Collector.URL()) if err != nil { fmt.Println("collector config does not produce valid url", err) return nil, err @@ -75,7 +75,9 @@ func newHttpCollectorClient( } func (client *httpCollectorClient) ConnectClient() (Connection, error) { - transport := &http2.Transport{} + transport := &http2.Transport{ + AllowHTTP: true, + } client.client = &http.Client{ Transport: transport,