mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-04 01:09:36 +02:00
let pass custom grpc dial opts (#2144)
This commit is contained in:
parent
7973ab43fe
commit
1b698053f6
1 changed files with 3 additions and 1 deletions
|
@ -59,7 +59,7 @@ type Options struct {
|
|||
}
|
||||
|
||||
// NewGRPCClientConn returns a new gRPC pomerium service client connection.
|
||||
func NewGRPCClientConn(opts *Options) (*grpc.ClientConn, error) {
|
||||
func NewGRPCClientConn(opts *Options, other ...grpc.DialOption) (*grpc.ClientConn, error) {
|
||||
ctx := context.TODO()
|
||||
if len(opts.Addrs) == 0 {
|
||||
return nil, errors.New("internal/grpc: connection address required")
|
||||
|
@ -105,6 +105,8 @@ func NewGRPCClientConn(opts *Options) (*grpc.ClientConn, error) {
|
|||
grpc.WithDisableServiceConfig(),
|
||||
}
|
||||
|
||||
dialOptions = append(dialOptions, other...)
|
||||
|
||||
if opts.WithInsecure {
|
||||
log.Info(ctx).Str("addr", connAddr).Msg("internal/grpc: grpc with insecure")
|
||||
dialOptions = append(dialOptions, grpc.WithInsecure())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue