Installing XSockets.NET - XSockets/XSockets.NET-4.0 GitHub Wiki
XSockets.NET is distributed through nuget.org and chocolatey.org. From Chocolatey you install our Windows Service and on Nuget we have all our packages for development. You can read more about all the packages after the installation samples.
In the nuget Package Manager Console run the command below to install the server.
PM> Install-Package XSockets.Server
####Start the server
Inside of the Main method start the server with the code below.
using XSockets.Core.Common.Socket;
using XSockets.Plugin.Framework;
using (var container = Composable.GetExport<IXSocketServerContainer>())
{
container.Start();
Console.WriteLine("Started, hit enter to quit");
Console.ReadLine();
}
###Install into OWIN (self hosted) Note: This requires .NET 4.5+ Open up the Package Manager Console and install the server
PM> Install-Package Microsoft.Owin.SelfHost
PM> Install-Package XSockets.Owin.Host
####How to register XSockets Middleware UseXSockets is an extension method for the OwinExtensions class.
using XSockets.Owin.Host;
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.UseXSockets(true);
}
}
class Program
{
static void Main(string[] args)
{
var url = "http://localhost:9090";
WebApp.Start<Startup>(url);
Console.WriteLine("Listening at " + url);
Console.ReadLine();
}
}
###Install into OWIN (IIS) Note: This requires .NET 4.5+ Open up the Package Manager Console and install the server
PM> Install-Package XSockets.Owin.Host
####How to register XSockets Middleware UseXSockets is an extension method for the OwinExtensions class.
using Microsoft.Owin;
using Owin;
using XSockets.Owin.Host;
[assembly: OwinStartupAttribute(typeof(MyApplication.Startup))]
namespace MyApplication
{
public partial class Startup
{
public void Configuration(IAppBuilder app)
{
app.UseXSockets(true);
}
}
}
So basically just call the UseXSockets extension from where you have your StartUp class for OWIN.