Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Junaidy
    @junaidy-johm
    Any tutorial in YouTube about chat app with centrifuge? Thanks
    1 reply
    Pavel Shatalov
    @seidju
    @FZambia Thanks a lot!
    Alexander Emelin
    @FZambia

    Hello! Just released Centrifugo PRO v3.1.0 - this is the first release of PRO version. Don't forget that you can check out all Centrifugo PRO features in sandbox mode – everything is available, just with restrictions on number of connections, API calls and node amount.

    https://github.com/centrifugal/centrifugo-pro/releases/tag/v3.1.0

    Alexander Emelin
    @FZambia
    Hey folks, Centrifugo v3.1.1 released! https://github.com/centrifugal/centrifugo/releases/tag/v3.1.1
    Alexander Emelin
    @FZambia
    Hey folks, me and @anton_silischev just published a post about Centrifugo and Laravel integration. Take a look – feedback is much appreciated, planning to post on Reddit tomorrow: https://centrifugal.dev/blog/2021/12/14/laravel-multi-room-chat-tutorial
    Pavel Shatalov
    @seidju
    Hi @FZambia! Could you please tell is there any way to notify backend when centrifugo client did disconnect from socket? For example, app was in background and ws was stopped. Couldn't find information in docs. Thanks a lot!
    Alexander Emelin
    @FZambia
    Centrifugo v4 roadmap ^^
    Alex Davidovich
    @alxsad
    Hi @FZambia Could you please help me with centrifugo client written in go? There is callback func (h *centrifugoTopicEventHandler) OnPublish(sub *centrifuge.Subscription, e centrifuge.PublishEvent) but on each message from topic e.ClientInfo always is nil. Is it expected behaviour? Thank you.
    @FZambia maybe is there other way to skip messages from topic sent by me?
    Alexander Emelin
    @FZambia
    @alxsad hello! e.ClientInfo is filled when publication issued using client protocol (using client.Publish method). If publication is sent over server API then it's always nil. To skip messages:
    • you can include client ID that sent message into message payload and have skip logic based on it
    • you can include some unique page identifier instead of ID into message payload
    • there is also field Meta in Publication - https://github.com/centrifugal/protocol/blob/master/definitions/client.proto#L134 - it was just recently added, needs some work to support it throughout Centrifugo stack. It will allow including some additional information into Publication which can be outside of actual Payload
    • you can also make sure that message processing is idempotent - i.e. processing message twice does not lead to side effects in your app
    Alex Davidovich
    @alxsad
    Thank you @FZambia
    zunnar
    @zunnar
    @FZambia Dear Aleksander can you support with error from centrifugo
    zunnar
    @zunnar
    centrifugo | {"level":"error","client":"2d5099ee-a963-4e56-bf29-e3539bcaebf2","error":"HTTP request error: Post \"http://127.0.0.1:8880/chat/centrifugo/connect/\": dial tcp 127.0.0.1:8880: connect: connection refused","time":"2022-02-02T15:43:09Z","message":"error proxying connect"}
    centrifugo | {"level":"info","client":"2d5099ee-a963-4e56-bf29-e3539bcaebf2","code":100,"command":"id:6 params:\"{\\"name\\":\\"js\\"}\"","error":"internal server error","reply":"id:6 error:{code:100 message:\"internal server error\"}","user":"","time":"2022-02-02T15:43:09Z","message":"client command error"}
    http://127.0.0.1:8880 -> server is runnig
    Alexander Emelin
    @FZambia
    @zunnar hello, Centrifugo can't access 127.0.0.1:8880 for some reason. Many such cases happen when developers run Centrifugo in Docker, when running in Docker Centrifugo does not have direct access to services running on host machine.
    zunnar
    @zunnar
    I can't use 127.0.0.1 but what if i use docker created interface ip?!
    Alexander Emelin
    @FZambia
    This should work, maybe your app must run on 0.0.0.0 in this case. You can also try http://host.docker.internal:8880
    zunnar
    @zunnar
    ok thx, i will try
    zunnar
    @zunnar
    Hi @FZambia Could you please help me with below error
    centrifugo | {"level":"error","client":"6d7ab60a-fac5-43fd-9b91-223ab172fa74","error":"unexpected HTTP status code: 400","time":"2022-02-04T08:16:01Z","message":"error proxying connect"}
    centrifugo | {"level":"info","client":"6d7ab60a-fac5-43fd-9b91-223ab172fa74","code":100,"command":"id:10 params:\"{\\"name\\":\\"js\\"}\"","error":"internal server error","reply":"id:10 error:{code:100 message:\"internal server error\"}","user":"","time":"2022-02-04T08:16:01Z","message":"client command error"}
    Alexander Emelin
    @FZambia
    Hi, that 400 is coming from app backend
    Pavel Shatalov
    @seidju
    Hi @FZambia, we faced crashes in SwiftCentrifuge framework, posted an issue at github - centrifugal/centrifuge-swift#61
    ywngr
    @ywngr
    Hi! Is it possible to safely migrate from redis to redis streams without loosing data? =) Im on 2.8.1
    Alexander Emelin
    @FZambia
    @ywngr hi, I don't think so - but loosing data in Redis should not be a problem if you are using Centrifugo in idiomatic way (data should be loaded from main database). Also Centrifugo v3 still provides list support (I suggest testing migration anyway)
    Alexander Emelin
    @FZambia
    livingrockrises
    @livingrockrises
    @furqanharoon were you able to fix this?
    centrifugal/centrifugo#396
    I was told it has to do with https://centrifugal.dev/docs/server/configuration#client_channel_limit
    cc @FZambia
    the problem is in our case we are using an SDK with single sock client messenger which collects updates on all transaction<txId> channels and let the devs know state changes through event emitters.
    can anyone suggest a way to tackle this?
    Alexander Emelin
    @FZambia
    Not 100% sure I understood a problem, but it seems you are trying to listen to all channels with a single client? This does not scale. Centrifugo should be used as a message transport, not a source of messages. I.e. publications should come from the backend where you have all the power to process them in an appropriate way.
    livingrockrises
    @livingrockrises
    for each transaction we have a transaction id and backend needs to send updates as to what happened with it (hash generated, mined, replaced etc). end user uses our sdk only so this single client is written in the sdk which listens to all transaction id channels
    Is there a way to unsubscribe from a channel once client is done? maybe that would solve the problem
    Alexander Emelin
    @FZambia
    Yes, possible to .unsubscribe()
    vzyrianov500
    @vzyrianov500
    Hi! I try to connect to Centrifugo from iOS via SwiftCentrifuge with the token generated by "centrifugo gentoken -u 7". And get the error "invalid token: signature is not valid". Is this right way of a token generation? How could I set the userID? Or the ID would get from the server according the token?
            let config = CentrifugeClientConfig()
            let url = "ws://my.domain:8000/connection/websocket?format=protobuf"
            centrifugeClient = CentrifugeClient(url: url, config: config, delegate: self)
    
            centrifugeClient?.setToken("xxx")
            centrifugeClient?.connect()
    Alexander Emelin
    @FZambia
    @vzyrianov500 gentoken is mostly for development, I think in you case your are generating token locally based on local secret, so generated token does not match secret used in running instance configuration
    4 replies
    Alexey Vasilyev
    @spajic

    Hi @FZambia ! I'm new to gitter and could not find how to search history. So maybe my question was already answered.

    I want to push lots of data to centrifugo frequently.
    Say I have ~5k channels, each of them I want to update every second.
    I think naive approach with just publishing in a loop would be too slow.
    So, publish lots of messages in short time. What is best practice to solve this task?

    Now I work via Ruby client "rubycent".

    I think about 2 options:

    a) I found mention of pipelining via json streaming in docs
    b) switch to grpc

    What is more promising?

    • implement batch publish via pipelining? (is it possible via ruby client, or I should construct POST requests by hand?)
    • switch to grpc? (does grpc client supports batches or pipelining in some form?)
    5 replies
    Alexander Emelin
    @FZambia

    Guys, I mentioned this in Telegram group, but also duplicate here: currently I am working on Centrifugo V4. Some description is here: centrifugal/centrifugo#500. Important things:

    Everything mentioned here is WIP – don't hesitate to provide feedback if any, that's very important at this stage while we are flexible

    3 replies
    slachtar
    @slachtar
    I'm new to centrifugo, I'm coming from deepstream.io,
    Channels looks equivalent to records in deepstream, but I read a "dangerous" sentence for me about channels: a channel get destroyed as soon as the last client unsubscribes from it.
    I'm working on a GPS tracking project, and I have a backend processes that publish into channels (car ids), but it may happen that no client is subscribed in that moment, but when a client got subscribed, it should be able to retrieve last channel data (last known car position in my case).
    Also I want to be able to generate events and have clients subscribed to that events receive event's data. Events never persist, so if a client is not subscribed when the event happens then it won't be able to get it from history.
    6 replies
    Alexander Emelin
    @FZambia

    The community meeting about Centrifugo v4 is tomorrow:

    Centrifugo v4 community call
    Thursday, June 23 · 3pm UTC – 4pm UTC
    Google Meet joining info
    Video call link: https://meet.google.com/vpc-znzd-cay

    Link to Google calendar event: https://calendar.google.com/event?action=TEMPLATE&tmeid=MTZwMG9rYTlqOW83M2E1MTY1Y3NocDg4OTQgczlmaWJiMTRxZzRnYzJ1OGx1YXZiM2IwOW9AZw&tmsrc=s9fibb14qg4gc2u8luavb3b09o%40group.calendar.google.com

    Agenda:

    1. Presentation about notable v4 changes/improvements
    2. Release plans
    3. Questions/feedback

    I think one hour may be not enough for everything, but we can theoretically make one more meeting later.

    Alexander Emelin
    @FZambia
    🔥🔥 Starting a call in 45 minutes 🔥🔥
    Alexander Emelin
    @FZambia

    https://github.com/centrifugal/centrifugo/releases/tag/v4.0.0-beta.1

    Just released v4.0.0-beta.1. Guys, if you depend on Centrifugo – give it a shot in dev env, it may be much harder to adapt after v4.0.0 non-beta release

    Yashasvi Chaudhary
    @arcticfloyd1984

    Hey guys
    Getting this error:

    TypeError: this._websocket is not a constructor
    at Centrifuge._setupTransport (centrifuge.js:466:1)
    at Centrifuge._connect (centrifuge.js:825:1)
    at Centrifuge.connect (centrifuge.js:1718:1)

    5 replies
    AmirOsman2020
    @AmirOsman2020

    Hello everyone, I've been looking around for a lightweight messaging server and I came across Centrifugo, I did a lot of research about it, read some blogs and watched some videos and it got me really interested.
    Am building a group messaging app and I'm currently using ejabberd XMPP it's a really good messaging server but it's kind of heavy and it consume a lot of memory, Centrifugo in the other hand seems lightweight compare to ejabberd but I have a few questions:
    I'm expecting 200K to 500K concurrent connections each sending up to 300 to 600 messages a day and I want to run Centrifugo on a dedicated server with the following specs:

    1. CPU: 2x AMD EPYC 7282 - 16Cores / 32 threads.
    2. Memory: 256 GB REG ECC - can get up to 512 GB if needed.
    3. Network: 10 Gbit/s Port.

    My question is, can my server running Centrifugo handle the expected connections?

    Alexander Emelin
    @FZambia
    Vukasin Nikodijevic
    @vukasin-nikodijevic

    Hi ppl,

    I'm new to centrifugo and exploring it as replacement solution for our current setup.

    Our current websocket auth setup works in the way that for each user after api login is provided token for websocket auth. In this scope, each user has it's own websocket auth token.

    I was checking centrifugo docs to support described setup but kinda failing to find.

    Is it possible and if so plz can you reference to docs / examples ?

    2 replies
    Vukasin Nikodijevic
    @vukasin-nikodijevic

    @FZambia is there any spec on NATS broker integration - atm I'm struggling to propagate message from NATS > Centrifugo. I'm using python v4 tornado example in POC.

    I found no user friendly documentation for NATS broker integration - beside of basic steps on how to configure integration.

    If I publish from Centrifugo, I see message in NATS subscribe:

    ╰─➤  nats sub "centrifugo.>"
    .
    .
    .
    [#1053] Received on "centrifugo.client.chat:index"
    
    chat:index��"{"input":"test333"}*
    2694$fd3865c3-e6c4-48c0-97e6-01f380a587f4�/{"first_name":"Alexander","last_name":"Emelin"}" {"extra":"extra for chat:index"}

    When I publish message from NATS in centrifugo.client.chat:index subject, nothing appears in tornado page.
    If publish from centrifugo admin ui - tornado page is receiving message.

    I've tried next messages:

    ╰─➤  echo '{ "channel": "chat:index", "data": { "input": "test2323" } }' | nats pub "centrifugo.client.chat:index"
    09:51:12 Reading payload from STDIN
    09:51:13 Published 61 bytes to "centrifugo.client.chat:index"
    ╰─➤  echo '{"input":"asasdsad111"}' | nats pub "centrifugo.client.chat:index"
    09:52:35 Reading payload from STDIN
    09:52:35 Published 24 bytes to "centrifugo.client.chat:index"
    6 replies
    Alexander Emelin
    @FZambia
    Ramarasu
    @developer-ram
    Hi, I am facing an issue in ws connection from client side, it shows permission denied ( Code : 103). But I have generated the JWT in backend and sent it to client. With the same JWT working fine, once I restart the centrifugo server. Am not sure, what is the issue
    1 reply
    leon-trye
    @leon-trye
    Hello, tell me why it says disconnected: 3500, invalid token?
     $key = $this->centrifugo->generatePrivateChannelToken((string)53, '$53',  time() + 5 * 60);
    const centrifuge = new Centrifuge("ws://127.0.0.4:8000/connection/websocket", {
                        token: "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjaGFubmVsIjoiJDUzIiwiY2xpZW50IjoiNTMiLCJleHAiOjE2NjIyMDg0MDl9.kFgpfukAhpFlII0DIPJiLIBGHbsl-QOd4i2aLpMLXCA",
                    });
    
                    const sub = centrifuge.newSubscription("$53");
    
                    centrifuge.on('connecting', function (ctx) {
                        console.log(`connecting: ${ctx.code}, ${ctx.reason}`);
                    }).on('connected', function (ctx) {
                        console.log(`connected over ${ctx.transport}`);
                    }).on('disconnected', function (ctx) {
                        console.log(`disconnected: ${ctx.code}, ${ctx.reason}`);
                    }).connect();
    
                    sub.on('publication', function (ctx) {
                        container.innerHTML = ctx.data.value;
                        document.title = ctx.data.value;
                    }).on('subscribing', function (ctx) {
                        console.log(`subscribing: ${ctx.code}, ${ctx.reason}`);
                    }).on('subscribed', function (ctx) {
                        console.log('subscribed', ctx);
                    }).on('unsubscribed', function (ctx) {
                        console.log(`unsubscribed: ${ctx.code}, ${ctx.reason}`);
                    }).subscribe();
    2 replies
    Ihar Tsiukulmin
    @the5x_gitlab
    How to fix this error?
    alt