Improve http2 / SSL support

This commit is contained in:
2021-12-10 22:33:47 +00:00
parent ea7ec683ef
commit d1406eeac8
2 changed files with 24 additions and 5 deletions
+5 -5
View File
@@ -15,7 +15,6 @@ package gql
import (
"crypto/tls"
"fmt"
"net"
"net/http"
"os"
"strconv"
@@ -77,15 +76,15 @@ func setCacheEnabled() bool {
}
func NewConnection() *GraphQL {
return &GraphQL{
g := GraphQL{
Endpoint: pickGraphqlEndpoint(),
HttpClient: &http.Client{
Transport: &http2.Transport{
DisableCompression: false,
AllowHTTP: true,
PingTimeout: 5 * time.Second,
DialTLS: func(network, addr string, cfg *tls.Config) (net.Conn, error) {
return net.Dial(network, addr)
PingTimeout: 10 * time.Second,
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true,
},
},
},
@@ -93,6 +92,7 @@ func NewConnection() *GraphQL {
Cache: setCacheEnabled(),
CacheStore: setupCache(),
}
return &g
}
func setupCache() *bigcache.BigCache {