Add support for custom transports
- Dominant language
- JavaScript
- Stars
- 9.3k
- Forks
- 802
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 5
Description
Hi!
As we know Node.js doesn't support XMLHttpRequest by default.
We can use polyfills and define them globally, for example [this comment introduce solution](https://github.com/grpc/grpc-web/issues/453#issuecomment-522022719)
It works but Server Streaming doesn't work properly - we are receiving messages only when the stream is ended, [more info here](https://grpc.io/blog/state-of-grpc-web/#f20).
> grpcweb allows server streaming methods to be called, but it doesn’t return data until the stream has closed.
I didn't test it in browsers, maybe this problem is only XHR polyfill related. I've tried all polyfills that I could find.
I've looked to [@improbable-eng/grpc-web](https://github.com/improbable-eng/grpc-web) solution, there we can use custom transport and it already has Node.js HTTP transport.
But seems to me this project was abandoned. I've talked with one contributor and he said that he doesn't have any connection to maintainers and the latest version was 10 months ago. He can't publish new versions to npm registry and I think this is a big problem.
So, here we have a great opportunity to make this lib a real standard of gRPC-Web. And it would be great if you provide ability to setup custom transport or at least Node.js HTTP.
For what needs I'm searching for this feature:
First - electron apps which could use this library. Because of Node.js backend inside it's having problems. For example I'm working on desktop gRPC/gRPC-Web client and can't use this library, but really want :)
Second - integration tests written on top of Node.js also could make a good option for testing gRPC-Web requests.
Contributor guide
Assessment
This issue has not been assessed yet.