If I build a website that has a built-in SignalR hub (single IIS site), such as http://www.asp.net/signalr/overview/getting-started/tutorial-getting-started-with-signalr-and-mvc,
can I use other apps to connect to it, such as WPF or whatnot. My impression is that I would need a standalone SignalR hub that runs on its own, on a different port.
You can use the same host. If you use windows auth you need to setup the credentials on the WPF client.
You can look at my WPF demo that uses Caliburn Micro for MVVM and my SignalR library for a MVVM/Aggregation friendly way of using SignalR
https://github.com/AndersMalmgren/SignalR.EventAggregatorProxy/tree/master/SignalR.EventAggregatorProxy.Demo.DotNet
Related
I'm aware that the library #microsoft/signalr can be used on the client-side to connect with a SignalR hub, but is it possible to integrate SignalR in a node server? We're trying to implement a chat system using SignalR with React Native as the client but we can't figure out how to integrate it into Node or is it just meant to be used with the ASP.NET server?
The SignalR server must be hosted in a .NET application, because it is implemented as a .NET Class Library. SignalR clients are available for many languages/platforms, including JavaScript and Node.
If you want to do real time communications or two way communication using Node as the server, you'll need to look into other options.
I am creating my website application in .net core 2.1. I have to deploy it in WebApp of Azure.
I am bit new to WebApp so not sure if I need to enable any service or any port on WebApp so Notfication works.
Otherwise normal way to show Notification is SignalR implemented.
1) Will SignalR will work for website hosted in WebApp?
If any Azure service that will do same please suggest
SignalR uses web sockets to connect with clients, so you will need to go into app settings and enable them for SignalR to work.
Here is a tutorial to help you set up your WebApp with SignalR:
https://learn.microsoft.com/en-us/aspnet/core/signalr/publish-to-azure-web-app?view=aspnetcore-2.2
Based on your scenario, Azure SignalR Service or Azure Notification Hub may be an option for you.
There is notification service in Azure Web Apps around sending push notification to Mobile Devices that are integrated with Azure.
In your case i assume you are talking about sending real time notifications within the web app ? Yes SignalR works great for that scenario , and you can look into dedicated SignalR service from Azure for this.
https://azure.microsoft.com/en-au/services/signalr-service/
Let's say, I have an enterprise application runs on Azure Web App Service. Among 100+ pages, I have 3-5 pages needs to be served real-time. to benefit from real-time capabilities of Azure SignalR Service, I want to make clients land on my SignalR application (which runs on RignalR Service). But I couldn't find any related example-article about it. How can I invoke a Hub method outside of the code? Any other approach to solve my problem is more than welcome. My main concern here is the performance of real-time pages.
If you have an ASP.NET Core SignalR Server (i.e. you have classes deriving from Hub in your application), you can't directly send messages to clients via the Azure SignalR Service. You'd have to provide an API in your ASP.NET Core application that does that.
Azure SignalR does also support a "serverless" mode in which you don't have a Hub on the server at all. In that model, clients connect directly to the service (instead of first connecting to your app) and then you can send messages to those clients using the REST API. This is a relatively new scenario so there isn't a lot of documentation. There are some blog posts and videos online on the subject, but not a lot of documentation.
If you already have an ASP.NET Core app, I'd suggest doing this by adding a REST API to your own application that allows other services in your application to send messages by calling this API. In the implementation of this API, you can use IHubContext<T> to send the messages.
Am trying to develop a mobile application which will be consuming an existing non-REST WCF service. What will be the best way to consume this service if i choose to develop the mobile application? Am new to mobile development and will be open to any suggestions.
Few things about the application as such:
Its an existing web application which we will be migrating to mobile
app.
The mobile app will need to have android/iOS versions so we are
thinking to develop hybrid app in either XAMARIN or IONIC.
The data-source for the application will be an already existing WCF
service.
We cannot rewrite or change the WCF service as we do not
have the permission to do so.
Security is an important aspect in this application.
I have only the end points and not the entire project. [Cannot edit the web.config or alter the methods to return JSON]
Am not asking for complete solution here and just for the directions. Any thoughts/suggestions will be really helpful.
Try using one of these modules to consume the WCF https://npms.io/search?q=WCF or https://npms.io/search?q=SOAP, or create another service that wraps/proxies the WCF and converts it to a REST or maybe JSON RPC interface, maybe something like this: https://github.com/kmvi/JsonRpc.ServiceModel
Consume that service in VS via Service Reference which generates proxy for you
I have created a small and simple chat with signalr on a azure website. That doesn't work as expected.
After some hours on Google I found out, that signalr should be implemented different on Azure.
What is best practise?
Any good examples?
It should work on both mobile and in normal browsers.
Per the docs at: http://www.asp.net/signalr/overview/deployment/using-signalr-with-azure-web-sites
Deploying a SignalR Web App to Azure App Service
SignalR doesn't add any particular complications to deploying an
application to Azure versus deploying to an on-premises server. An
application that uses SignalR can be hosted in Azure without any
changes in configuration or other settings (though for WebSockets
support, see Enabling WebSockets on Azure App Service below.)...
To get signalr working when deploying to azure, I had to use
appBuilder.SetDataProtectionProvider(new MachineKeyProtectionProvider());
inside my Startup.cs Configure() method.
link to MachineKeyProtectionProvider gist
This is actually a workaround to this problem but it seems to work.
Follow this link : ASP.NET 5 app in Azure doesn't work with SignalR