Skip to content

Commit

Permalink
Merge branch 'v1-feature-transport-grpc' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
dobyte committed Oct 25, 2022
2 parents ae893b3 + c1e58e8 commit 2696772
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions transport/grpc/transporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"github.com/dobyte/due/router"
"github.com/dobyte/due/transport"
"github.com/dobyte/due/transport/grpc/gate"
"github.com/dobyte/due/transport/grpc/internal/client"
"github.com/dobyte/due/transport/grpc/internal/server"
"github.com/dobyte/due/transport/grpc/node"
)
Expand All @@ -23,12 +24,18 @@ func NewTransporter(opts ...Option) *Transporter {

// NewGateClient 新建网关客户端
func (t *Transporter) NewGateClient(ep *router.Endpoint) (transport.GateClient, error) {
return gate.NewClient(ep)
return gate.NewClient(ep, &client.Options{
CertFile: t.opts.client.certFile,
ServerName: t.opts.client.serverName,
})
}

// NewNodeClient 新建节点客户端
func (t *Transporter) NewNodeClient(ep *router.Endpoint) (transport.NodeClient, error) {
return node.NewClient(ep)
return node.NewClient(ep, &client.Options{
CertFile: t.opts.client.certFile,
ServerName: t.opts.client.serverName,
})
}

// NewGateServer 新建网关服务器
Expand Down

0 comments on commit 2696772

Please sign in to comment.