AKAISSocketServerExtension 1.0.0.1

Sample url: https://wsecho.azurewebsites.net/

With this extension you can specify unlimited hub at run-time, initial client connection starts or join existing hub.
Channels isolated by using hub.
Ideal for application like multi room, p2p chat or IoT service channel implementations.

Install-Package AKAISSocketServerExtension -Version 1.0.0.1
dotnet add package AKAISSocketServerExtension --version 1.0.0.1
<PackageReference Include="AKAISSocketServerExtension" Version="1.0.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AKAISSocketServerExtension --version 1.0.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Asp.Net Core WebSocket Manager Extension.

Sample url: https://socket.karayakar.com/indexws.html

With this extension you can specify unlimited hub at run-time, initial client connection starts or join existing hub.
Channels isolated by using hub.
Ideal for application like multi room, p2p chat or IoT service channel implementations.

Kestrel 2.1.3
Asp.Net Core 2.1.4

wss://socket.karayakar.com/hub/xyz...
wss://socket.karayakar.com/hub/abc...

public class Startup
{
    public Startup(IConfiguration configuration)
    {
        Configuration = configuration;
    }

    public IConfiguration Configuration { get; }
    
	public void ConfigureServices(IServiceCollection services)
    {
        services.AddWebSocketManager();
        services.AddTransient<PublicMessageHandler, PublicMessageHandler>();
      //   ........
    }
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env, IServiceProvider serviceProvider)
{
	app.UseMiddleware<WebSocketManagerMiddleware>(serviceProvider.GetService<PublicMessageHandler>());
	var webSocketOptions = new WebSocketOptions()
        {
            KeepAliveInterval = TimeSpan.FromSeconds(120),
            ReceiveBufferSize = 4 * 1024
        };
        app.UseWebSockets(webSocketOptions);
}

.....

....

public class Program
{
public static void Main(string[] args)
{
BuildWebHost().Run();
}
public static IWebHost BuildWebHost()
{

        return new WebHostBuilder()
            .UseKestrel(options =>
            {
                //options.ThreadCount = 10;
                //options.UseConnectionLogging("test");
                //options.Listen(IPAddress.Loopback, 5000);
                //options.Listen(IPAddress.Loopback, 5001, listenOptions =>
                //{
                //    listenOptions.UseHttps("testCert.pfx", "testPassword");
                //});
            })
            .ConfigureAppConfiguration((builderContext, config) =>
            {
                IHostingEnvironment env = builderContext.HostingEnvironment;

                config.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true);
                //.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true);
            })
            .UseContentRoot(Directory.GetCurrentDirectory())
            .UseIISIntegration()
            .UseStartup<Startup>()
            .UseUrls("http://localhost:5000/")
            .Build();

        //host.Run();
    }
}

Asp.Net Core WebSocket Manager Extension.

Sample url: https://socket.karayakar.com/indexws.html

With this extension you can specify unlimited hub at run-time, initial client connection starts or join existing hub.
Channels isolated by using hub.
Ideal for application like multi room, p2p chat or IoT service channel implementations.

Kestrel 2.1.3
Asp.Net Core 2.1.4

wss://socket.karayakar.com/hub/xyz...
wss://socket.karayakar.com/hub/abc...

public class Startup
{
    public Startup(IConfiguration configuration)
    {
        Configuration = configuration;
    }

    public IConfiguration Configuration { get; }
    
	public void ConfigureServices(IServiceCollection services)
    {
        services.AddWebSocketManager();
        services.AddTransient<PublicMessageHandler, PublicMessageHandler>();
      //   ........
    }
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env, IServiceProvider serviceProvider)
{
	app.UseMiddleware<WebSocketManagerMiddleware>(serviceProvider.GetService<PublicMessageHandler>());
	var webSocketOptions = new WebSocketOptions()
        {
            KeepAliveInterval = TimeSpan.FromSeconds(120),
            ReceiveBufferSize = 4 * 1024
        };
        app.UseWebSockets(webSocketOptions);
}

.....

....

public class Program
{
public static void Main(string[] args)
{
BuildWebHost().Run();
}
public static IWebHost BuildWebHost()
{

        return new WebHostBuilder()
            .UseKestrel(options =>
            {
                //options.ThreadCount = 10;
                //options.UseConnectionLogging("test");
                //options.Listen(IPAddress.Loopback, 5000);
                //options.Listen(IPAddress.Loopback, 5001, listenOptions =>
                //{
                //    listenOptions.UseHttps("testCert.pfx", "testPassword");
                //});
            })
            .ConfigureAppConfiguration((builderContext, config) =>
            {
                IHostingEnvironment env = builderContext.HostingEnvironment;

                config.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true);
                //.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true);
            })
            .UseContentRoot(Directory.GetCurrentDirectory())
            .UseIISIntegration()
            .UseStartup<Startup>()
            .UseUrls("http://localhost:5000/")
            .Build();

        //host.Run();
    }
}

Release Notes

PublicMessageHandler added

Version History

Version Downloads Last updated
1.0.0.1 194 10/5/2018
1.0.0 154 10/4/2018