by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Alexander Emelin
    @FZambia
    Actually at some point this was made occasionally, and I never thought it can be widely used. So at moment this is an undocumented feature:) I think the best way is use protobuf definitions from https://github.com/centrifugal/centrifugo/blob/master/misc/proto/api.proto but instead of using GRPC build them with protoc compiler and construct messages, then send HTTP request
    andthereitgoes
    @andthereitgoes

    hello quick question about centrifuge-dart
    I am using connecting using a secret token through the centrifuge-dart client, but on the server, I am getting the following error

    {"level":"info","client":"be291d0f-fafd-4d0e-a201-e518d428b5e3","data":"\ufffd\u0001\b\u0001\u0010\u0000\u001a\ufffd\u0001\n\ufffd\u0001eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJUZXN0IE9yZ2FuaXNhdGlvbiAxIiwic3ViIjoiNWRhYTAyMzgtN2YwYy0xMWVhLWIxMTItZWFlNTU2OWY4NjAxIiwiZXhwIjoxNTg5OTg3NjYxfQ.fwwM8-L4mqdpK2kFteoYmb6TDfoQ3J0oxiyfCmbIDlY","error":"invalid character 'Õ' looking for beginning of value","user":"","time":"2020-05-19T15:15:30Z","message":"error decoding command"}

    we use the centriuge-js, centrifuge-java and centrifuge-go clients and they connect fine and there is no such error with the exact same token

    what am I missing?
    Not sure why is the dart client adding \ufffd\u0001\b\u0001\u0010\u0000\u001a\ufffd\u0001\n\ufffd\u0001 additional UTF-16 characters to the token
    I don't know dart very well, but I have used the example code https://github.com/centrifugal/centrifuge-dart/blob/master/example/console/simple.dart
    Alexander Emelin
    @FZambia
    @andthereitgoes answered inside Github issue
    andthereitgoes
    @andthereitgoes
    @FZambia aha. Thanks I missed that. I hope nothing has to change on the server side. And also hope that the other clients can continue to work alongside dart client as there will be data generate from other clients (which don't use protobuf protocol)
    Alexander Emelin
    @FZambia
    As soon as you send JSON encoded data in your payloads everything should work fine
    Alexander Emelin
    @FZambia
    bwt you mentioned Java client - it also works in the same way as Dart client - i.e. only uses Protobuf inside
    andthereitgoes
    @andthereitgoes
    oh okay
    thanks
    Alexander Emelin
    @FZambia
    @andthereitgoes have you tried it?
    andthereitgoes
    @andthereitgoes

    @FZambia yes, tried it. and connect/disconnect works. But I have another problem for which I couldn't find anything in the code.

    After connecting I am trying to subscribe to a private channel such as $5daa0238-7f0c-11ea-b112-eae5569f8601#5daa0238-7f0c-11ea-b112-eae5569f8601

    When I send the subscribe, on the server I am seeing the following in the log

    {"level":"info","client":"436bb802-c9a3-471c-99d1-36b94cdf32c3","command":"id:2 method:SUBSCRIBE params:\"\\nJ$5daa0238-7f0c-11ea-b112-eae5569f8601#5daa0238-7f0c-11ea-b112-eae5569f8601\\022\\000\" ","error":"103: permission denied","reply":"id:2 error:<code:103 message:\"permission denied\" > ","user":"5daa0238-7f0c-11ea-b112-eae5569f8601","time":"2020-05-21T15:41:11Z","message":"client command error"}

    \\nJ$5daa0238-7f0c-11ea-b112-eae5569f8601#5daa0238-7f0c-11ea-b112-eae5569f8601\\022\\000\

    I am sure this is related to protobuf format, but not sure what to do. I read in the readme that subscribe to private channels with JWT is supported. So not sure what I am missing.

    Pavel
    @wispoz
    hello
    i have some issue can you help me this 1 version of centrifugo
    andthereitgoes
    @andthereitgoes
    hi @FZambia Just quick question about clustering - I know centrifugo doesn't support clustering. So is there anyway to make centrifugo HA?
    Alexander Emelin
    @FZambia
    Read about Redis engine
    you can also make HA setup with memory engine - just configure second instance as backup in your load balancer
    Pavel
    @wispoz
    @FZambia hello, i use v1, and unsubscribe doesnt work(
    i unseubscribe from chanell nut i get messages(
    how i can remove channel from _subs ?
    andthereitgoes
    @andthereitgoes
    @FZambia Thanks. So all data will be sycned by Redis engine i.e. it wouldn't matter which centrifugo server node, the client connects to - is that right?
    Alexander Emelin
    @FZambia
    @wispoz hello, v1 is not supported, very sorry
    @andthereitgoes yes, exactly
    andthereitgoes
    @andthereitgoes
    in default mode centrifugo uses memory engine
    @FZambia are there any downsides of using redis engine instead of memory engine?
    Alexander Emelin
    @FZambia
    @andthereitgoes read the docs
    andthereitgoes
    @andthereitgoes
    @FZambia discord link doesn't work
    invite invalid
    and I can't find centrifugo on discord
    Alexander Emelin
    @FZambia
    could you try the link to Discord in readme badge: https://github.com/centrifugal/centrifugo ?
    andthereitgoes
    @andthereitgoes
    Thanks that worked @FZambia
    Efe Ertan
    @Ertan_EFE_CSEFE_twitter
    hi all
    I want to ask a question
    how can I send message to channel without subscription?
    is it possible?
    we want to implement basic peer to peer chat app, how can we achieve ? is there sample app? thanks
    Tomisin Jenrola
    @ToJen
    concerning the gomobile implementation from a few years ago. did the contributors find that a library written in java/objective-c performed much faster than one generated from golang by gomobile for those same languages? @FZambia
    Alexander Emelin
    @FZambia

    how can I send message to channel without subscription?

    one obvious option is to send message over backend API

    concerning the gomobile implementation from a few years ago. did the contributors find that a library written in java/objective-c performed much faster than one generated from golang by gomobile for those same languages?

    To be fair – I don't have any reports, I know that there are usages but no statistics at all. Personally I'd go with native approach

    Tomisin Jenrola
    @ToJen

    concerning the gomobile implementation from a few years ago. did the contributors find that a library written in java/objective-c performed much faster than one generated from golang by gomobile for those same languages?

    To be fair – I don't have any reports, I know that there are usages but no statistics at all. Personally I'd go with native approach

    alright thanks

    Tomisin Jenrola
    @ToJen
    btw @FZambia i did a small test on iOS: https://github.com/ToJen/awmy
    Alexander Emelin
    @FZambia
    @ToJen gomobile works on iOS and Android, no doubts. I tested centrifuge-go library on both devices: Android and iOS. Also gomobile supports bitcode on iOS in latest versions. I think the problems with gomobile are:
    1) Increased application size comparing to native approach
    2) If you come across a problem while developing application and it will reproduce only on several devices – there is a chance that no fix will be available (since gomobile not actively maintained by Go team and not too popular actually), i.e. using gomobile is a bit risky in my opinion. But maybe everything will work just fine.
    somavoyager
    @somavoyager
    I am building a game server in golang as a side project. Now I am looking to get into websockets to connect the players and the game. I am concerned about game servers crashing, proxies and players retrying to connect to the game again. It looks like centrifuge does what I am looking for. Excellent work!
    somavoyager
    @somavoyager
    Do I need separate redis instance if I centrifugo server?
    Alexander Emelin
    @FZambia
    @somavoyager hello, there are two built-in engines at moment, Memory and Redis - depending on your requirements you can choose any, so Redis is not a hard requirement, but you can only scale to several machines with Redis. And soon with Nats server (in v2.6.0)
    somavoyager
    @somavoyager
    Thank you Alex for the response. After reading the docs and watching your presentation on YouTube, I am convinced to use Centrifugo rather than writing a custom one. I am glad you chose websocket rather than custom tcp implementation. The TLS configuration is so hard. Anyway in my game, there are 3 different communication channels between the game server and the players. The game server sends private information to each player, broadcasts messages to all players, player, players send messages to the game and game interact non-critical information (chat, emoji, gif link) in a chat channel. How do I design this with Centrifugo? I don't fully follow private channels. So I don't know whether I should create private channels or user channels for private messages. Should I create the following channels for each game? game-<unique id>#<player id>, game-<unique id>:game-messages, game-<unique id>:player-messages, game-<unique id>:chat
    Alexander Emelin
    @FZambia
    Answered in Telegram:)

    for a record:

    what private channels allow to do is make sure nobody without proper permission can subscribe to a channel since you are signing each subscription attempt on your backend. User limited channels do not require extra round trip to your backend since Centrifugo knows user ID after connect and can make sure nobody else can subscribe to this channel.