GithubHelp home page GithubHelp logo

signalnow's Introduction

SignalNow: Serverless Signaling and Real-Time Messaging

SignalNow is a real-time signaling service built with Azure SignalR and Azure Functions. SignalNow key features:

  1. Serverless.
  2. Real-time and easily scalable with Azure Functions and SignalR.
  3. Extensible authentication with integrated authentication using Microsoft Azure Active Directory, Microsoft Accounts, GitHub accounts, as well as key-based mechanism.

How to get started

  1. Deploy
  2. Use (.NET Core 2.2, Unity 2018.3+).

Deploy to Azure

Deploy to Azure

A minimal C# sample

using System; 
using Microsoft.SignalNow.Client;

string graphName = "signalnowkey"; // Use "graph.microsoft.com" for Azure Active Directory (AAD) and Microsoft Graph, or "github.com" for GitHub  
string userName = "vlad"; // or "[email protected]" for AAD, or "vladkol" for GitHub 
string company = "microsoft"; // or MSFT AAD Tenant Id, or GitHub organization name
string team = "cse"; // or any AAD group id, or GitHub team name, or * for not limiting it to a specific group
string deviceId = Guid.NewGuid().ToString(); // May be device's MAC address 

// If Azure Active Directory used, the authenticating app should have permissions sufficient for calling checkMemberGroups API 
// See https://docs.microsoft.com/en-us/graph/api/user-checkmembergroups?view=graph-rest-beta (as of today, it is Directory.Read.All) 
string authBearer = "INSERT YOUR SIGNALNOW KEY OR BEARER TOKEN HERE";  

SignalNowClient client = new SignalNowClient("mysignalnow"); // server will be resolved to mysignalnow.azurewibsites.net 

client.NewMessage += async (SignalNowClient signalNow, string senderId, string messageType, string messagePayload)=>
{
    switch(messageType.ToUpperInvariant())
    {
        case "PING":
            Console.WriteLine($"Received a PING message from {senderId}. Payload: {messagePayload}");
            await client.SendMessage(senderId, false, "PONG", messagePayload, true); 
            break;
        case "PONG":
            Console.WriteLine($"Received a PONG message from {senderId}");
            break;
        default:
            break;
    }
};

if (await client.Connect(userName,
        deviceId,
        company,
        team,
        authBearer,
        graphName))
{
    Console.WriteLine($"Connected to {client.ServerAddress} as {client.UserId}");
    await client.SendMessageToAll("PING", $"Hello!", false);
}
else
{
    Console.WriteLine($"Cannot connect to {client.ServerAddress}");
}

Details

Serverless Signaling Documentation

SignalNowKey Authentication

Signaling Messages

TURN REST Authentication

Deployment

Client SDKs and Samples

Source code

Azure Function app (Azure/Functions/SignalNow folder)

ARM Template

.NET Core 2.2 Client and demo app (Client/CS/CS-Sample folder)

Unity 2018.3 app (Scripting Runtime .NET 4.x, both with .NET Standard 2.0 and .NET 4.x compatibility levels, works on iOS, Android, WinDesktop, UWP, MacOS, Client/CS/CS-Unity/SignalNowAR folder)

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

signalnow's People

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.