diff --git a/pkg/common/types.go b/pkg/common/types.go index ad2b4aa..5435c85 100644 --- a/pkg/common/types.go +++ b/pkg/common/types.go @@ -68,6 +68,7 @@ type ( Username string `json:"username"` Password string `json:"password"` Space string `json:"space"` + UseHttp bool `json:"use_http"` } OutputOption struct { diff --git a/pkg/nebulagraph/client.go b/pkg/nebulagraph/client.go index c650adc..250cefb 100644 --- a/pkg/nebulagraph/client.go +++ b/pkg/nebulagraph/client.go @@ -181,6 +181,10 @@ func (gp *GraphPool) initConnectionPool() error { return err } } + if gp.graphOption.UseHttp { + conf.UseHTTP2 = true + } + pool, err := graph.NewSslConnectionPool(hosts, conf, sslConfig, graph.DefaultLogger{}) if err != nil { return err @@ -217,6 +221,7 @@ func (gp *GraphPool) initSessionPool() error { graph.WithMaxSize(gp.graphOption.MaxSize), graph.WithMinSize(gp.graphOption.MinSize), graph.WithSSLConfig(sslConfig), + graph.WithHTTP2(gp.graphOption.UseHttp), ) if err != nil { return err