stepancheg / grpc-rust

Rust implementation of gRPC
MIT License
1.37k stars 124 forks source link

Missing port info in "Uri.Authority" and lead to run failing in Service Mesh framework #140

Closed leeyr338 closed 5 years ago

leeyr338 commented 5 years ago

The Uri.Authority would be: Authority = Host Name + Port No

And if URL protocol is using a default port, say port 80 for http URL, then only in that case Authority = Host Name (Port No is assumed to be 80),

Whereas Host Name is either Domain Name or I.P Address.

So, When I used the "grpc lib" to build my micro-services in a service mesh framework (Linkerd e.g.), Linked will assumed the target service's port as default 80.

jsonrpc-59f9bd7f45-lzkbx.57128 > 192-168-1-95.auth.test.svc.cluster.local.80: Flags [P.], cksum 0x8592 (incorrect -> 0x8b04), seq 311:350, ack 233, win 229, options [nop,nop,TS val 1793815060 ecr 1793814747], length 39: HTTP

But I want to send the request to another port.

I hack the code and compare it with other grpc implement, and found grpc-rust only set host to Authority.

Header::new(Bytes::from_static(b":authority"), self.host.clone()),

Is possible to add port info to "Uri.Authority"? So the Authority will be:

host:port
leeyr338 commented 5 years ago

Uniform Resource Identifier (URI): Generic Syntax