Skip to content
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

WebSockets or socket.io interface #152

Open
oliverhausler opened this issue Jan 5, 2020 · 6 comments
Open

WebSockets or socket.io interface #152

oliverhausler opened this issue Jan 5, 2020 · 6 comments

Comments

@oliverhausler
Copy link

oliverhausler commented Jan 5, 2020

Just like NATS, Liftbridge only offers a gRPC interface. gRPC is great for servers but doesn't work inside browsers, so I would consider a second WebSockets or socket.io interface as extremely useful.

Right now, to use NATS/Liftbridge from a browser directly, a proxy is required.

@gedw99
Copy link

gedw99 commented Jan 11, 2020

Grpc does work. Grpc gateway proxy server based on nginx or the golang grpc gateway.

This gateway is the standard approach to this problem.

But I am not super familiar with the exact message pattern semantics that liftbridge client should enforce. Web grpc can't do bidirectional steaming for example but that's rarely needed.

Maybe someone else can offer advice about that aspect

@oliverhausler
Copy link
Author

Does this solve the problem? It solves the proxy on the server, so that NATS/liftbridge isn't exposed on the internet, but the client problem is a different one: Web browsers only allow outgoing http(s) traffic via JS. If I am not mistaken, there is no way to contact a grpc server directly. I found something interesting, though, which might work:

https://github.com/grpc/grpc-web

Still, it would be a lot easier if there was a direct way for connecting via socket.io, even though less performant, I believe performance would be better than running through proxies.

@tsingson
Copy link
Contributor

a websocket server via liftbridge client as bridge to liftbridge/nats is work great.
about 10K android apk ( websocket client ) connect to 5 websocket server.

websocket connect to gRPC should work, if message is not plain string , it need some data searilized / un-searilized.

@winwisely99
Copy link

winwisely99 commented Feb 24, 2020

We got grpc golang and flutter web working using envoy and grpc gateway

Now seeing if liftbridge works through it for flutter web.

The advantage is that it's all pure grpc and it's codegen for client and server

@joe-getcouragenow
Copy link

You can run envoy without docker BTW on linux and mac. Not windows ( yet).
https://www.getenvoy.io/

@alexisread
Copy link

Issue #375 opened for an MQTT bridge. This could allow for an embedded MQTT broker that handles websockets, for a browser connection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants