Create a websocket server olny for .net core console application without using Asp .net core packages - asp.net-core

We need to migrate our application to .Net core and we had a dependency with a websocket library build for .Net Framework 3.5 . websocket-sharp
Until now i can not found a libray implementation for websocket that use only .Net Core not Asp Net core.
example of library with ASP are :
Kestrel
SingelR
But we shall not use ASP packages juste to integrate à websocket implementation.
Can anyone help me to find a websocket implementation using only .Net core layer not ASP.Net core ?

Here is a web socket server that does NOT depend on Kestrel or ASP, making it fully compatible with .NET Core and Mono.
https://github.com/jchristn/WatsonWebsocket
It should be very futureproof because of its minimal dependencies. Note that the author is a former Cisco Engineer with several other easy-to-use .net client/server libraries. I have used his other libraries with tremendous ease and success. He deserves support and respect for his efforts.
A big plus about his libraries is that they are quite minimal. They make getting up and running as easy as possible by offering only the most basic essentials you would want for servers and clients. Things like client-management, request routing, etc will depend on you to implement. I find this highly favorable.
UPDATE 11/7/2020: Joel has stated that he intends to rewrite the underlying portions of WatsonWebSocket so that it does not rely on HttpListener or http.sys. It will rely on his alternate custom http listener. This is great news because HttpListener is deprecated and has a sketchy future.

The abstract ClientWebSocketClass is an implementation for websockets that is not dependent on ASP.NET core. So you can do use that for client side communication with any websocket implemtnation.
The server side part will need an HTTP server since websocket connection are achieved by creating a normal HTTP request and the connection is upgraded to websocket. So you need a webserver to receive the initial request.

Related

How to version SignalR websockets?

We are building a web application in Asp.Net Core that will be used to centralize and communicate with a lot of instances of a custom servers(which is in C# too).
We need versionning, because updating those custom servers is really time consuming and can be a blocker for people to install newer version of the web app.
For the HTTP part, it's "easy", we have to use the Asp.Net Core versionning and a given version of the custom server will know how to communicate with a given version of the web app.
But we have a SignalR service that is used to provide notification to the custom servers from the web app, and request some data, some actions, ... Is there a way to provide several version of the client interface for this? And having the signalR server able to transform the message to each version?
Thank you

Is it possible to use DevForce with new .NET5, NET6?

As I know DevForce use WCF for the communications between client and server.
But in newer version of .NET (Core 3.1, .NET5, .NET6 etc) WCF services not supported.
Is it possible to configure DevForce to use endpoints based on GRPC\WebApi instead of WCF?
As a trend for the future, you can try using gRPC, CoreWCF, and ASP.NET Core MVC instead of WCF. With the.NET upgrade, some technologies have been fully ported, but not WCF, and the replacement for WCF is the technology mentioned above.
The following article lists some of their characteristics for your reference, I hope it can help you.

WCF replacement in. Net Core

I need to create client application and server service application, that uses Remote Procedure Calls with windows authentification and impersonation.
Since WCF is not supported in Net Core and gRPC uses http/2, which not supppoted by Windows Authentification are there any alternatives I could use for that?
WCF is a Windows-only framework, while.net Core is cross-platform.
The links below contain some usage and examples that you can refer to.What replaces WCF in .Net Core?
Thanks.
I have found the ServiceWire package to be an excellent replacement for NamedPipes and WCF, especially if you do not need to queue requests or share objects.
While more modern approaches would be preferred, if you already have heavy WCF dependencies or WCF knowledge, you can look into CoreWCF.

How to run asp.net core application is work with all web server? Is that reason Kestrel?

I don't understand actually . How to asp.net core application be cross platform?
Is that reason kestrel? I think web server take request and send to Kestrel bla bla. Why them need to Kestrel?
How to asp.net core application be cross platform?
It's common that an application needs a runtime. Java, JS, Python, … you always need something on the target system to make your app work. For asp.net core it's the asp.net core runtime and this runtime is available for many platforms. That's why you can run your app on all of these platforms. See https://dotnet.microsoft.com/download/dotnet-core/2.2 for available packages.
Is that reason kestrel?
Kestrel is the web server part. (If you write a command line app, you don't need kestrel). You can compare it with e.g. Tomcat in Java.
I think web server take request and send to Kestrel bla bla.
In most situations (except very small setups) we always have a proxy (web) server that takes the request and forwards it to another web server. While both seem to be very similar they have different roles.
Common (but just an example) setup:
Proxy (web) server: Terminate TLS, load balance to multiple backend web servers.
Backend (web) server: Run the application. But focus on this part. No TLS certs to configure, easy to scale,...
Why them need to Kestrel?
Again while some languages / frameworks use modules for existing servers (e.g. PHP) others use separate servers (Java, JS, C#, …). For c# it's the kestrel web host.

Why people mixed ASP.Net MVC and web-api in same project

i need few reason for which people mixed ASP.Net MVC and web-api in same project. when we can develop a full project in mvc only then why web api need to include. also we can host webapi project separately which can server request to MVC and other devs or mobile devs etc.discuss the reason and advantages.
some one answer :
We have recently built a project within MVC and WebApi, we used the WebApi purely because from a Mobile Apps perspective. We allowed the mobile dev guys to call our methods within our MVC application instead of them having to go and create the same function.
WebApi allows to create services that can be exposed over HTTP rather than through a formal service such as WCF or SOAP. Another difference is in the way how WebApi uses Http protocol and makes it truly First class Http citizen.
still the above answer is not clear to me and i think this is not the reason for which people mixed ASP.Net MVC and web-api in same project.
so anyone mind to discuss the actual reason and advantages with example scenario.
thanks
Each have a purpose. Most of the time it's usually caused by legacy code. I know we included documentation which used MVC, but we're fully webapi.
FYI, was MS's auto documentation for WebApi ironically.