Comments (4)
@xurwxj hello! Great to see your interest to this project.
That auth
logic is for Centrifugo server only (this library supposed to be a core for Centrifugo v2). Centrifugo must integrate with backend in any programming language. So in that case the only generic way to authenticate user is passing it's credentials from client with HMAC sign to verify on Centrifugo side.
But if you are talking about using this library from Go language code then it's already possible to authenticate user in any way you want using convenient middleware approach - as shown in example. You have request
and context
- so can implement any logic and pass whatever you want to context and set correct user ID to client credentials
.
That example is for Websocket and SockJS as HTTP server middleware is used. For GRPC it will be possible in GRPC-specific way - using interceptor. Though we have no clients for GRPC endpoint yet, only proof of concept client
Does it make sense?
Also I must note that this library is not a complete work at moment, API will break - but I suppose you saw this warning in repo description.
from centrifuge.
@FZambia thanks for your great job. This library is very meaningful to me.
I want to use it to try some of the following functions:
- private chat, support offline messages, until they are subscribed.
- groups of chat, support offline messages, until they are subscribed.
- message subscriptions, including at most one delivery and at least one subscription for different scene.
- save all message in db for history pull or offline message redelivery
so any advise base on this library?
from centrifuge.
This library must anyway be used together with robust persistent storage for messages - i.e. main application database if you want reliable delivery and history, library provides a best effort to recover some missed messages (in configured time interval and limited by configured size) but the only source of truth is your main database. You better consider Centrifuge lib only as persistent connection hub and transport for real-time messages. It has at most once delivery – so when you need at least once for example then you had to implement sth on top of this library in your code - message acks maybe.
It's hard for me to give a concrete advices at moment - as I had no real experience building sth complicated on top of this lib. I am interested in any feedback from you whatever you end up with - any downside can theoretically be fixed at this stage I hope.
from centrifuge.
@FZambia thanks a lot. I need to think about it, maybe I will build a new library based on your library. I will feed back when I have a progress.
from centrifuge.
Related Issues (20)
- ServerJoin event not sent HOT 4
- client.send(data) disconnects clients on empty data HOT 2
- Occasional data race in `initMetricsRegistry` HOT 1
- Clients being disconnected due to "Slow" reason - throttling options HOT 14
- Redis broker pool size HOT 4
- KeyDB connect HOT 3
- private channel HOT 2
- Deprecated ProtocolVersion1 will be removed soon HOT 1
- Client level heartbeat config HOT 7
- Custom recover at connection level HOT 4
- High memory consumption HOT 7
- Apply suggestions from fieldalignment for frequently used objects HOT 1
- Making send call to return a reply HOT 1
- Publish() causes a runtime error when no client subscribed to then channel. HOT 2
- [feature] presence with massive amount of active users HOT 6
- Remove SockJS transport HOT 1
- Embed Gorilla WebSocket HOT 1
- How Many Concurrent RPC Requests can server handle? HOT 2
- [feature] Return error when publishing with incorrect history TTL + history meta TTL configuration
- [bug] Investigate occasional panic in tests
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from centrifuge.