code-server icon indicating copy to clipboard operation
code-server copied to clipboard

[Feat]: please add support to expose grpc:// uris (http2)

Open sbussard opened this issue 1 year ago • 5 comments

What is your suggestion?

please add support to expose grpc:// uris (http2) -via proxy or any other way

Why do you want this feature?

to enable development with grpc-web

Are there any workarounds to get this functionality today?

No (?)

Are you interested in submitting a PR for this?

I wouldn't know where to start

sbussard avatar Jul 20 '23 01:07 sbussard

Is the idea to make gRPC calls through the proxy to forwarded ports possible? So if you have a gRPC backend on localhost:8081 and you want to make requests to it through domain.tld/proxy/8081/ for example?

If so, I think https://github.com/coder/code-server/issues/5723 is related. Currently HTTP is the only supported protocol but it would be nice to support others (in the linked issue we talk about forwarding MongoDB and others).

I think maybe what we need is a way to proxy arbitrary data without needing to be protocol-aware.

code-asher avatar Jul 20 '23 20:07 code-asher

Absolutely agree! Raw TCP and UDP servers would be nice.

GRPC is just http2 but with the grpc:// part at the beginning of the url, so it might be a very small change if code-server supports http2

sbussard avatar Jul 22 '23 01:07 sbussard

Ah interesting. I see the issue you opened in proxy-agents, hopefully they can tell us more about whether http2 is supported but at a glance it looks like it might not be. Maybe we need to use a different package or add support upstream.

I imagine the best workaround today would probably be to use something else to do the proxying.

code-asher avatar Jul 24 '23 16:07 code-asher

Thanks for your response.

I imagine the best workaround today would probably be to use something else to do the proxying.

Would that be a setting, or a code change?

sbussard avatar Jul 31 '23 01:07 sbussard

Neither, I was thinking of using an external reverse proxy like NGINX. So there would be one entry for code-server itself and then another for proxying arbitrary ports.

If an external proxy is used then code-server's could be disabled with --disable-proxy and the VSCODE_PROXY_URI environment variable could be used to make the right domain show up in the ports panel if needed.

code-asher avatar Jul 31 '23 17:07 code-asher