#702·grpc-web

Path prefixes: how?

Author: smnbbrvCreated Jan 9, 2020Updated Jun 19, 2026

Hi all,

I have a very basic question and cannot find an answer yet.

This is what I have from docs:

typescript
const echoService = new EchoServiceClient('http://localhost:8080', null, null);

That's all fine until it comes to deployment to the real world where I have just one domain (let's say this is a limitation) and want to split the traffic by path prefixes as one normally does in REST.

In other words this is the desired URL structure:

and the configuration of the client would be

typescript
const echoService = new EchoServiceClient('https://example.com/grpc-proxy', null, null);

or even more preferrable

typescript
const echoService = new EchoServiceClient('/grpc-proxy', null, null);

There is an option to configure some sort of path prefix strip and make one more proxy step on the envoy itself, so it looks something like

browser => envoy proxy strip path prefix => envoy grpc web proxy => grpc server

However, it looks dirty.

And I am still unsure whether the grpc-web library itself is going to support the non-root path prefixes such as described above in the long run .

Is this possible? Is there an example how to configure envoy in this case?

Thanks in advance.