grpc-proxy icon indicating copy to clipboard operation
grpc-proxy copied to clipboard

Allow for Director to set OutgoingMetadata on proxied calls

Open mwitkow opened this issue 8 years ago • 3 comments

As mentioned in https://github.com/improbable-eng/grpc-web/issues/91 and in discussion of https://github.com/mwitkow/grpc-proxy/pull/16 (@peteredge's comment) we need a way to add metadata to outgoing calls.

The https://github.com/improbable-eng/grpc-web/issues/91 broke because of gRPC-Go changes in 1.5 that separated the inbound and output contexts. This meant that it no longer forwarded the metadata.

I propose the following change:

type StreamDirector func(ctx context.Context, fullMethodName string) (*grpc.ClientConn, error)

to

type StreamDirector func(ctx context.Context, fullMethodName string) (context.Context, *grpc.ClientConn, error)

Where the returned context will be used as a base for the call.

Thoughts? @yifanzz

mwitkow avatar Nov 20 '17 17:11 mwitkow

Just ran into this problem. The readme needs adjustment as well, since it reflects to old behavior

cleanerx avatar Nov 22 '17 15:11 cleanerx

@mwitkow that looks good to me. Will create a PR for the change.

yifanzz avatar Nov 22 '17 16:11 yifanzz

It seems this was fixed in last commit but issue was not closed.

ghost avatar Jan 30 '18 15:01 ghost