PHPackages                             baskof147/centrifuge - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. baskof147/centrifuge

ActiveLibrary

baskof147/centrifuge
====================

Unofficial Centrifugo C# client for Unity

00C#

Since Jun 7Pushed 11mo agoCompare

[ Source](https://github.com/baskof147/centrifuge-csharp)[ Packagist](https://packagist.org/packages/baskof147/centrifuge)[ RSS](/packages/baskof147-centrifuge/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Centrifuge C# Client
====================

[](#centrifuge-c-client)

[![Nuget](https://camo.githubusercontent.com/7aef3b2b295ef15369b8b48b90ed68499b13acaefab93a1a52cd763cd818e10a/68747470733a2f2f696d672e736869656c64732e696f2f6e756765742f762f43656e74726966756765)](https://camo.githubusercontent.com/7aef3b2b295ef15369b8b48b90ed68499b13acaefab93a1a52cd763cd818e10a/68747470733a2f2f696d672e736869656c64732e696f2f6e756765742f762f43656e74726966756765)

This SDK provides a client to connect to Centrifugo

⚠️ Working in progress
======================

[](#️-working-in-progress)

- SDK is not completed yet.
- This library is translated from [centrifuge java sdk](https://github.com/centrifugal/centrifuge-java). It is not stable.

Installation
============

[](#installation)

```
dotnet add package Centrifuge --version 1.0.0

```

Platforms
=========

[](#platforms)

- .NET Framework 4.8
- Unity 2022.3+ (Api .NET Framework)

### TODO

[](#todo)

- Code Refactor
- History
- Presence

### Example

[](#example)

```
using System;
using System.Threading;
using Centrifuge;

namespace Example
{
    internal class Program
    {
        private static string TOKEN = "";

        public class TokenGetter : ConnectionTokenGetter
        {
            public override void GetConnectionToken(ConnectionTokenEvent e, TokenCallback cb)
            {
                cb(null, TOKEN);
            }
        }

        public class Listener : EventListener
        {
            public override void OnConnecting(Client client, ConnectingEvent e)
            {
                Console.WriteLine("onConnecting");
            }

            public override void OnConnected(Client client, ConnectedEvent e)
            {
                Console.WriteLine("onConnected");
            }

            public override void OnDisconnected(Client client, DisconnectedEvent e)
            {
                Console.WriteLine("onDisconnected");
            }

            public override void OnError(Client client, ErrorEvent e)
            {
                Console.WriteLine("onError1" + e.Error);
            }

            public override void OnMessage(Client client, MessageEvent e)
            {
                Console.WriteLine("onMessage");
            }

            public override void OnSubscribed(Client client, ServerSubscribedEvent e)
            {
                Console.WriteLine("onSubscribed");
            }

            public override void OnSubscribing(Client client, ServerSubscribingEvent e)
            {
                Console.WriteLine("onSubscribing");
            }

            public override void OnUnsubscribed(Client client, ServerUnsubscribedEvent e)
            {
                Console.WriteLine("onUnsubscribed");
            }

            public override void OnPublication(Client client, ServerPublicationEvent e)
            {
                Console.WriteLine("onPublication");
            }

            public override void OnJoin(Client client, ServerJoinEvent e)
            {
                Console.WriteLine("onJoin");
            }

            public override void OnLeave(Client client, ServerLeaveEvent e)
            {
                Console.WriteLine("onLeave");
            }
        }

        public class SubListener : SubscriptionEventListener
        {
            public override void OnPublication(Subscription sub, PublicationEvent e)
            {
                var d = System.Text.Encoding.UTF8.GetString(e.Data);
                Console.WriteLine("onPublication" + d);
            }

            public override void OnJoin(Subscription sub, JoinEvent e)
            {
                Console.WriteLine("onJoin");
            }

            public override void OnLeave(Subscription sub, LeaveEvent e)
            {
                Console.WriteLine("onLeave");
            }

            public override void OnSubscribed(Subscription sub, SubscribedEvent e)
            {
                Console.WriteLine("onSubscribed");
            }

            public override void OnUnsubscribed(Subscription sub, UnsubscribedEvent e)
            {
                Console.WriteLine("onUnsubscribed");
            }

            public override void OnSubscribing(Subscription sub, SubscribingEvent e)
            {
                Console.WriteLine("onSubscribing");
            }

            public override void OnError(Subscription sub, SubscriptionErrorEvent e)
            {
                Console.WriteLine("onError" + e.Error);
            }
        }

        public static void Main(string[] args)
        {
            Options opts = new Options()
            {
                Token = TOKEN,
                TokenGetter = new TokenGetter(),
            };

            Client client = new Client("ws://localhost:8088/connection/websocket", opts, new Listener());
            client.Connect();

            var sub = client.NewSubscription("message#0f63396b-3b29-4072-849b-a886ac08a5e2", new SubscriptionOptions(), new SubListener());
            sub.Subscribe();

            Thread.Sleep(200000);
        }
    }
}
```

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity14

Early-stage or recently created project

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/cc09854935ffc01823397903ce6eb1e2fd240e2d2caeb47afb49a16f1d05cf20?d=identicon)[baskof147](/maintainers/baskof147)

---

Top Contributors

[![srfaytkn](https://avatars.githubusercontent.com/u/19591219?v=4)](https://github.com/srfaytkn "srfaytkn (9 commits)")[![ozgursoy](https://avatars.githubusercontent.com/u/13810383?v=4)](https://github.com/ozgursoy "ozgursoy (5 commits)")[![baskof147](https://avatars.githubusercontent.com/u/6277248?v=4)](https://github.com/baskof147 "baskof147 (4 commits)")

### Embed Badge

![Health badge](/badges/baskof147-centrifuge/health.svg)

```
[![Health](https://phpackages.com/badges/baskof147-centrifuge/health.svg)](https://phpackages.com/packages/baskof147-centrifuge)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
