Skip to content

Commit 93f145f

Browse files
authored
Merge pull request #54 from HarrisChu/support_http2_lts
support http2
2 parents 509a486 + 5db262b commit 93f145f

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

pkg/common/types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ type (
6868
Username string `json:"username"`
6969
Password string `json:"password"`
7070
Space string `json:"space"`
71+
UseHttp bool `json:"use_http"`
7172
}
7273

7374
OutputOption struct {

pkg/nebulagraph/client.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ func (gp *GraphPool) initConnectionPool() error {
181181
return err
182182
}
183183
}
184+
if gp.graphOption.UseHttp {
185+
conf.UseHTTP2 = true
186+
}
187+
184188
pool, err := graph.NewSslConnectionPool(hosts, conf, sslConfig, graph.DefaultLogger{})
185189
if err != nil {
186190
return err
@@ -217,6 +221,7 @@ func (gp *GraphPool) initSessionPool() error {
217221
graph.WithMaxSize(gp.graphOption.MaxSize),
218222
graph.WithMinSize(gp.graphOption.MinSize),
219223
graph.WithSSLConfig(sslConfig),
224+
graph.WithHTTP2(gp.graphOption.UseHttp),
220225
)
221226
if err != nil {
222227
return err

0 commit comments

Comments
 (0)