{"id":17926265,"url":"https://github.com/mjaric/fenix","last_synced_at":"2025-03-24T03:31:21.687Z","repository":{"id":34294243,"uuid":"171943927","full_name":"mjaric/fenix","owner":"mjaric","description":".NET implementation of Phoenixframework websocket socket protocol","archived":true,"fork":false,"pushed_at":"2022-04-28T06:35:10.000Z","size":369,"stargazers_count":30,"open_issues_count":5,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-09T11:02:24.526Z","etag":null,"topics":["phoenix-channels","phoenix-elixir","phoenix-framework","websocket"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mjaric.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-21T20:55:10.000Z","updated_at":"2024-08-17T05:10:40.000Z","dependencies_parsed_at":"2022-08-08T00:15:36.172Z","dependency_job_id":null,"html_url":"https://github.com/mjaric/fenix","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjaric%2Ffenix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjaric%2Ffenix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjaric%2Ffenix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjaric%2Ffenix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mjaric","download_url":"https://codeload.github.com/mjaric/fenix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245204575,"owners_count":20577374,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["phoenix-channels","phoenix-elixir","phoenix-framework","websocket"],"created_at":"2024-10-28T21:00:07.983Z","updated_at":"2025-03-24T03:31:21.413Z","avatar_url":"https://github.com/mjaric.png","language":"C#","funding_links":[],"categories":["Unity"],"sub_categories":[],"readme":"# Fenix\nThread safe .NET Standard 2 implementation of Phoenix framework websocket protocol.\n\n## Supported/Tested .NET Runtime\n\n- NETCore 2.1.0\n- Mono 5.16.0.221\n- .NET Framework 4.6 and above\n\n## Dependencies:\n- Newtonsoft.Json 12.0.1\n\n## Usage\n\n#### Add Dependency to Fenix NuGet Package\nAdd Fenix nuget dependency either using your IDEs Package Manager tool or using command line:\n\n```\n$ dotnet add package Fenix\n```\nor amend your csproj/vbproj by adding:\n```\n\u003cPackageReference Include=\"Fenix\" Version=\"0.1.*\" /\u003e\n```\nand then build your project for example:\n```\n$ dotnet build MyProject.csproj\n```\n\n#### Create Fenix Socket\n\n```c#\nuse Fenix;\n\n\n// some constants\nconst token = \"dsa90disadojsaoijadoiajsodiajs\";\n\n// Defaults should be ok, but you can tweak some options, e.g. tur on logging, max retries etc.. \nvar settings = new Settings();\nvar socket = new Socket(settings);\ntry\n{\n    var uri = new Uri(\"ws://localhost:4000/socket/websocket\");\n    // \"token\" is not required, but below is demo how to pass parameteters while connecting\n    await _socket.ConnectAsync(uri, new[] {(\"token\", token)});\n    \n    var channel = _socket.Channel(\"room:lobby\", new {NickName = \"Timotije\"});\n    channel.Subscribe(\"new_msg\", (ch, payload) =\u003e\n    {\n        Console.WriteLine($@\"\n        Got LOBBY message\n        {payload.Value\u003cstring\u003e(\"body\")}\n        \");\n    });\n    \n    var result = await channel.JoinAsync();\n    Console.WriteLine($\"Lobby JOIN: status = '{result.Status}', response: {result.Response}\");\n    \n    await channel.SendAsync(\"new_msg\", new {body = \"Hi guys 2\"});\n    \n    Task.Delay(10000)\n        .ContinueWith(async task =\u003e { await channel.LeaveAsync(); })\n        .ConfigureAwait(false);\n}\ncatch (Exception ex)\n{\n    Console.WriteLine($\"Error: [{ex.GetType().FullName}] \\\"{ex.Message}\\\"\");\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjaric%2Ffenix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmjaric%2Ffenix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjaric%2Ffenix/lists"}