简体   繁体   中英

Is it possible to use a Self Hosted Console Application as a Signal R Server if it is not publicly accessible?

I want to run a self hosted C# console application that acts as a Signal R server that broadcasts to a ASP.NET MVC web application acting as a client at PokerConquest.com.

Whilst the website is publicly accessible.. does the server console application need to be publicly accessible? The communication will be one way (server to client). The self hosted console application can 'see' the outside world / make web requests etc.. it's just not publicly accessible.

All the samples you see online use localhost like this..

The server..

string url = "http://127.0.0.1:8088";
var SignalR = WebApp.Start(url);

And the client..

var connection = new HubConnection("http://127.0.0.1:8088/");
var myHub = connection.CreateHubProxy("MyHub");

which is great if your signal r servers and clients are on the same machine but a lot of the time they wont be..

So is it possible for a non publicly accessible self hosted console app to act as a signal r server and broadcast to a publicly accessible web app client?

Signalr broadcasts are sent to clients that connect to the Signalr server (using Web Sockets or traditional AJAX).

If the clients cannot connect to the server, nothing will work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM