Allow for Director to set OutgoingMetadata on proxied calls
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
Just ran into this problem. The readme needs adjustment as well, since it reflects to old behavior
@mwitkow that looks good to me. Will create a PR for the change.
It seems this was fixed in last commit but issue was not closed.