THRIFT-3251 Add http transport for server to Go lib
Client: Go
Patch: claudemiro <dimiro1@gmail.com>
This closes #785
diff --git a/test/go/src/common/client.go b/test/go/src/common/client.go
index e55dc6d..4251d91 100644
--- a/test/go/src/common/client.go
+++ b/test/go/src/common/client.go
@@ -25,6 +25,7 @@
"flag"
"fmt"
"gen/thrifttest"
+ "net/http"
"thrift"
)
@@ -75,10 +76,21 @@
}
switch transport {
case "http":
- trans, err = thrift.NewTHttpClient(fmt.Sprintf("http://%s/service", hostPort))
+ if ssl {
+ tr := &http.Transport{
+ TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
+ }
+ client := &http.Client{Transport: tr}
+ trans, err = thrift.NewTHttpPostClientWithOptions(fmt.Sprintf("https://%s/", hostPort), thrift.THttpClientOptions{Client: client})
+ fmt.Println(hostPort)
+ } else {
+ trans, err = thrift.NewTHttpPostClient(fmt.Sprintf("http://%s/", hostPort))
+ }
+
if err != nil {
return nil, err
}
+
case "framed":
trans = thrift.NewTFramedTransport(trans)
case "buffered":