Skip to content

Commit

Permalink
disable http/2
Browse files Browse the repository at this point in the history
Looks like the simplepush.io server does not speak http/2 (which is the
default in more "recent" golang versions).
  • Loading branch information
rck committed Jul 6, 2017
1 parent 3a3c022 commit 872b1db
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion simplepush.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"crypto/cipher"
"crypto/rand"
"crypto/sha1"
"crypto/tls"
"encoding/base64"
"encoding/hex"
"errors"
Expand Down Expand Up @@ -112,7 +113,10 @@ func Send(m Message) error {
u.Path = resource
urlStr := fmt.Sprintf("%v", u)

client := &http.Client{}
tr := &http.Transport{
TLSNextProto: make(map[string]func(string, *tls.Conn) http.RoundTripper),
}
client := &http.Client{Transport: tr}

resp, err := client.PostForm(urlStr, data)
if err != nil {
Expand Down

0 comments on commit 872b1db

Please sign in to comment.