New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support gRPC-Web protocol #43
Comments
Last time I looked at this package I was informed that it's designed for flutter. I don't use dart on the server, but instead golang. I use http 1.1 and a VPN entire provide security where I can't tolerate domains. For example in on premise projects and where the endpoint on both ends is a dynamic IP. In those cases a private dht is used as a closed DNS to match up addresses up to organisations. |
See the improbable git repo for a grpc-web implementation that support normal grpc and grpc with browsers using websockets to give bi-directional streaming. It's golang, not dart based but much easier and flexible than the nginx and cpp way. |
No-one is talking about nginx or c++ here. This issue is for implementing the gRPC-Web protocol in Dart. |
did not know :) sounds good... |
Hi, any updates and plans on this requirement? I plan to use grpc/http2 only (displacement of old http1 REST and websockets) in a new flutter project. For web interface, I plan to try angulardart v5 because it uses the same dart language. But after some research, I found out there were no native dart grpc-web support. So far, I found out:
To workaround it, I may try to use |
Sounds like there's a lot of interest for this, so I've moved it up on my list of priorities. Absolutely no guarantees, but I expect to start looking at it around end of next week. In the meantime, if anyone wants to pitch in, I'll happily take PRs for this! |
@jakobr-google Thank you very much for your quick reply and hard work. 👍 |
+1 Thats exactly what i am looking to us it for too. Flutter
…On Fri, 16 Mar 2018 at 09:48 sgon00 ***@***.***> wrote:
@jakobr-google <https://github.com/jakobr-google> Thank you very much for
your quick reply and hard work. 👍
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#43 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ATuCwoYK5Q-aXlZqZzNaRLABlRu89lswks5te3xXgaJpZM4RITAe>
.
|
Just to make sure we're on the same page: Flutter is already supported. This issue is for adding support for web browsers, too. |
Thanks. I should clarify then.
The Client is Flutter and the Server is golang for me, so i have 2
requirements:
- The GRPC golang code to produce Dart Client code that can be used inside
Flutter
- The GRPC golang code to produce Dart Cliet code that can be using inside
Dart Web.
- WHY ? because for some functionality i need to use a webview inside
flutter and also just standard browser.
…On Fri, 16 Mar 2018 at 11:29 Jakob Andersen ***@***.***> wrote:
Just to make sure we're on the same page: Flutter is already supported.
This issue is for adding support for web browsers, too.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#43 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ATuCwsE7XaoH341uMFsbxcbjJGtL6dqRks5te5QGgaJpZM4RITAe>
.
|
@jakobr-google this improvement will be compatible with Google Cloud Platform Endpoints ? |
@pcariel from what I can tell, for Cloud Endpoints, you configure a REST/JSON mapping that you can use from the browser, instead of talking gRPC. It doesn't look like they support gRPC-Web, AFAICT, so fixing this issue won't help with that, unfortunately. For those following this issue, please keep in mind that
This issue tracks adding support for a gRPC-Web client channel, as well as server support for gRPC-Web. |
I want to live in a world where your gRPC Dart server could serve your Flutter app and your AngularDart web-app without any hassle. |
So do I!
…On Fri, Mar 23, 2018 at 11:21 AM Leo Cavalcante ***@***.***> wrote:
I want to live in a world where your gRPC Dart server could serve your
Flutter app and your AngularDart web-app without any hassle.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#43 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AABCij3gZzHAUVubzuALPsNy9KgfoFgWks5thT0jgaJpZM4RITAe>
.
|
Hi, I'm really excited by all this; it would be great to also have Dart Web support for gRPC. We could then write all our back-end services using gRPC (using any supported implementation language) and access it from clients built using Dart from both Flutter and Dart web. Really this becomes a reality; watching this space... |
Am I correct in my understanding that the planned gRPC-Web client channel functionality will work with AngularDart on the browser? I ask this because I am in actual need of the gRPC-Web client channel functionality for an AngularDart web app, and was leaning towards @improbable-eng's Typescript based gRPC-Web. As the previous posters have alluded to, adding gRPC-Web client channel natively to Dart would essentially nearly complete the common communication stack. It would nicely complement @improbable-eng's Go proxy. I look forward to this functionality. |
I second this; really look forward to have gRPC accessible from the browser via Dart. |
I also wanted to use GRPC in my angulardart app, to communicate with a remote service. As I understand from here its not possible yet? |
Yes it's not possible yet |
@HeNKiEeEeE it is not trivially possible yet, but you still can run your gRPC server behind a gRPC-Web enabled proxy like Nginx, Envoy or gRPC Web Proxy from Improbable and rely on Dart's JS interop on the client. |
Do we know if this is being worked on and if so, super cool - and when to expect? |
I have an initial attempt here wav/grpc-web-dart at a client over HTTP/1.1. It does basic RPC against a golang server. It's used in a flutter app to get through a firewall. The part that calls the HttpClient would need to switch to XHR if in the browser here: It's just a simple request and response once you parse the protocol message data. I may continue it when I get a bit more time. |
Having a full implementation is for me the missing component to give dart and angulardart a trial in my company. |
@wav why did you say "to get through a firewall" ? normal grpc uses port 443 ( if secure). Would that not also get through a firewall . Just want to understand and learn.... |
Currently I'm working in a MS environment. I took the approach of using HTTP/1.1 as a "non deep investigative" approach to getting the app through a few environments where I cannot use HTTP/2. In this case it's a "perimeter" firewall/proxy/...? serving several sites on the same port inside a company network. The certificate is configured there. It appears to do packet inspection and doesn't seem to like HTTP/2 (it proxies many websites on the same port). I haven't worked out why. If I try open an HTTP/2 TLS connection it doesn't work either. Again, I haven't worked out why. Other golang apps are fine. Also, if I want to put it behind IIS or run it in an App Service in Azure only HTTP/1.1 traffic seems to get through. In this environment, I also don't use a TLS connection as it's handled by the "perimeter". |
Any updayrs on this ? |
same here along with the pull request for proper json interop |
I want grpc backend built with python and access it with frontend designed with AngularDart. I suppose that grpc-web needs to be supported for AngularDart. This issue seems to get grpc-web support for grpc-dart. Sorry for being naive at this, but please help me understand, am I missing something. In case I am looking at wrong place please help me understand how I can get AngularDart base web frontend access grpc backend designed in python. |
Support from the browser could now also benefit flutter applications that use https://github.com/flutter/flutter_web |
Q: Can a "Flutter for web" project using grpc-dart(non web) be built to deploy for the web? |
@1l0 I don't think so, the lib is highly tied to |
@leocavalcante Thanks. |
Any news on this? |
I merged the grpc-web branch. It is now published in version 2.0.0 |
@sigurdm I am confused. grpc-dart is currently at v0.4.1 what is this 2.0.0 version you speak of? |
@joelmarks-wf you are seeing the releases on Github (that seems to be out of use). Check https://pub.dev/packages/grpc |
Ahhh. Great! Does that mean you can remove the last part from https://pub.dev/packages/grpc#notes "It currently supports the the Flutter and Dart native platforms. The potential addition of gRPC-Web is tracked in issue 43."? |
We still need to do a bit more testing before we declare this fully done, but yes there should be enough here for testing. Do let us know if you try it, and how that worked! |
I tried it for one of my pet projects and it mostly worked like a charm, so thanks for that! One of the issues is that it doesn't seem to work with more recent versions of the toolchain around
I get this message when I run
and my app doesn't run. Haven't tried building with dart2js, though. I moved to these version to make it work:
With these versions there are no warnings and the app works just fine in the browser. The only other issue I ran into was with a bidirectional stream endpoint I had in my files. It sort of worked for one message, but then behaved really weird and often times would just disconnect. From what I understand it's not currently supported by the grpc-web spec. Also I used the improbable implementation embedded in my go application, which also explicitly states that this is not supported. Maybe it would be possible to directly throw an exception in case someone tries to use such an endpoint over a grpc-web channel. Other than that it worked great and simplified my code base a lot. Awesome work! |
Have you tried v. 2.0.0+1 it should fix the issue you see with webdev? |
Good point. I filed #200 |
Oh, hadn't seen the +1 release. I'll give it a shot later. Thanks a lot @sigurdm |
Worked! |
Is would be useful for everyone is there was an example that use GRPC-Web for FLutter Web, Desktop and Mobile. |
In the current form you cannot use grpc-web from flutter Desktop. I'm not sure we have the resources to maintain another example currently. But would welcome external contributions. |
Fair enough. I can make a demo repo.
Can you explain why Flutter Desktop cannot use GRPC ? Is it related to AOT ?
…On Wed, 26 Jun 2019, 15:47 Sigurd Meldgaard, ***@***.***> wrote:
Is would be useful for everyone is there was an example that use GRPC-Web
for FLutter Web, Desktop and Mobile.
In the current form you cannot use grpc-web from flutter Desktop.
I'm not sure we have the resources to maintain another example currently.
But would welcome external contributions.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#43?email_source=notifications&email_token=AE5YFQSTS7E5LUDYACROYPDP4NXOVA5CNFSM4EJBGAPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYTSOZI#issuecomment-505882469>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AE5YFQTMYAUFNN6GWH546ZDP4NXOVANCNFSM4EJBGAPA>
.
|
It can use grpc, but not grpc-web. |
Ok makes sense. Thanks for the clarification. I will work up a demo and post as a new issue |
Is there any way to use grpc-web protocol in Flutter mobile apps? |
Currently grpc web is tied to HttpRequest from dart:html. It should be possible to generalize it. I opened an issue #216. |
See the gRPC-Web protocol document for details.
We should be able to support this by making a
GrpcWebChannel
that implements theClientChannel
interface.The text was updated successfully, but these errors were encountered: