All Projects → NetCoreStack → Websockets

NetCoreStack / Websockets

Licence: other
WebSockets Inception

Projects that are alternatives of or similar to Websockets

Websocketd
Turn any program that uses STDIN/STDOUT into a WebSocket server. Like inetd, but for WebSockets.
Stars: ✭ 15,828 (+13090%)
Mutual labels:  proxy, websockets
Websockify
Websockify is a WebSocket to TCP proxy/bridge. This allows a browser to connect to any application/server/service.
Stars: ✭ 2,942 (+2351.67%)
Mutual labels:  proxy, websockets
Ws Tcp Relay
A simple relay between WebSocket clients and TCP servers
Stars: ✭ 186 (+55%)
Mutual labels:  proxy, websockets
Proxykit
A toolkit to create code-first HTTP reverse proxies on ASP.NET Core
Stars: ✭ 1,063 (+785.83%)
Mutual labels:  aspnetcore, proxy
Pushpin
Proxy server for adding push to your API
Stars: ✭ 3,050 (+2441.67%)
Mutual labels:  proxy, websockets
Aspnetcore.proxy
ASP.NET Core Proxies made easy.
Stars: ✭ 234 (+95%)
Mutual labels:  aspnetcore, proxy
Websocat
Command-line client for WebSockets, like netcat (or curl) for ws:// with advanced socat-like functions
Stars: ✭ 3,477 (+2797.5%)
Mutual labels:  proxy, websockets
WebCam-Streaming
Web-cam live streaming with websockets and SignalR with ASP.NET Core just for fun and to learn new things. 😀👨🏻‍💻
Stars: ✭ 31 (-74.17%)
Mutual labels:  aspnetcore, websockets
Tunneller
Allow internal services, running on localhost, to be accessed over the internet..
Stars: ✭ 346 (+188.33%)
Mutual labels:  proxy, websockets
Megalodon
Mastodon, Pleroma and Misskey API client library for node.js and browser
Stars: ✭ 52 (-56.67%)
Mutual labels:  proxy, websockets
Omega
Real-time issue tracker optimized for small teams
Stars: ✭ 115 (-4.17%)
Mutual labels:  websockets
Quicssh
SSH over QUIC
Stars: ✭ 116 (-3.33%)
Mutual labels:  proxy
Nassh Relay
Relay Server for the Secure Shell Chromium plugin
Stars: ✭ 118 (-1.67%)
Mutual labels:  proxy
Testcafe Hammerhead
A powerful web-proxy used as a core for the TestCafe testing framework. 🔨 😃
Stars: ✭ 119 (-0.83%)
Mutual labels:  proxy
Spec
The AsyncAPI specification allows you to create machine-readable definitions of your asynchronous APIs.
Stars: ✭ 1,860 (+1450%)
Mutual labels:  websockets
Mphx
A little library to let you make multiplayer games easily with Haxe. No longer maintained and better options are available.
Stars: ✭ 118 (-1.67%)
Mutual labels:  websockets
Amqproxy
An intelligent AMQP proxy, with connection and channel pooling/reusing
Stars: ✭ 115 (-4.17%)
Mutual labels:  proxy
Samples.aspnetcore Identityserver4
IdentityServer4 sample with .NET Core and ASP.NET Core 2.0
Stars: ✭ 115 (-4.17%)
Mutual labels:  aspnetcore
Anycable
Polyglot replacement for Ruby WebSocket servers with Action Cable protocol
Stars: ✭ 1,610 (+1241.67%)
Mutual labels:  websockets
Gobetween
☁️ Modern & minimalistic load balancer for the Сloud era
Stars: ✭ 1,631 (+1259.17%)
Mutual labels:  proxy

Cross-Platform WebSockets Proxy

Minimalist websocket framework for .NET Core. You can use it on your APIs to communicate among your various client types.

NuGet NuGet

Latest release on Nuget

Usage for API - Service Layer

Startup ConfigureServices

// Add NetCoreStack Native Socket Services.
services.AddNativeWebSockets<ServerWebSocketCommandInvocator>();

Startup Configure

 app.UseNativeWebSockets();

Controller with dependency injection

public MyController(IConnectionManager connectionManager)
{
    _connectionManager = connectionManager;
}

[HttpPost(nameof(SendAsync))]
public async Task<IActionResult> SendAsync([FromBody]SimpleModel model)
{
    var echo = $"Echo from server '{model.Message}' - {DateTime.Now}";
    var obj = new { message = echo };
    var webSocketContext = new WebSocketMessageContext { Command = WebSocketCommands.DataSend, Value = obj };
    await _connectionManager.BroadcastAsync(webSocketContext);
    return Ok();
}

Clients

Startup ConfigureServices

// WebSockets for Browsers
services.AddNativeWebSockets<AgentsWebSocketCommandInvocator>();

// Client WebSocket - Proxy connections
var builder = services.AddProxyWebSockets();

var connectorname = $"TestWebApp-{Environment.MachineName}";
builder.Register<CustomWebSocketCommandInvocator>(connectorname, "localhost:7803");

// Runtime context factory
builder.Register<AnotherEndpointWebSocketCommandInvocator, CustomInvocatorContextFactory>();

Startup Configure

// Client WebSocket - Proxy connections
app.UseProxyWebSockets();

// WebSockets for Browsers
app.UseNativeWebSockets();

// Use MVC
app.UseMvc();

Invocator With Dependency Injection on Clients

public class CustomWebSocketCommandInvocator : IClientWebSocketCommandInvocator
{
    private readonly IConnectionManager _connectionManager;
    public CustomWebSocketCommandInvocator(IConnectionManager connectionManager)
    {
        _connectionManager = connectionManager;
    }

    public Task InvokeAsync(WebSocketMessageContext context)
    {
        // Sending incoming data from backend to the clients (Browsers)
        _connectionManager.BroadcastAsync(context);
        return Task.CompletedTask;
    }
}
public class ClientDiscoveryController : Controller
{
    private readonly IWebSocketConnector _connector;
    public ClientDiscoveryController(IWebSocketConnector<CustomWebSocketCommandInvocator> connector)
    {
        _connector = connector;
    }

    [HttpGet]
    public async Task<IActionResult> KeepAlive()
    {
        await _connector.SendAsync(new WebSocketMessageContext
        {
            Command = WebSocketCommands.DataSend,
            Value = new { Id = 1, Name = "Hello World!", DateTime = DateTime.Now }
        });

        return Ok();
    }
}

Prerequisites

ASP.NET Core

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].