How can I use SignalR Hubs / Proxies without SignalR connection? - asp.net

Here is my situation:
I have a 4-tier web application consisting of browser, web server, application servers and database.
Browser and application server should communicate in a RPC-style way.
The backend will run on windows machines, so I will use IIS as web server The application needs real time communication between application server and browser.
I want to use a SignalR connection for the communication between browser and web server. For the communication between web server and application server's I want to use a plain TCP connection.
I think this approach will enable me to send JSON messages between browser and application servers. But how can I realize a RPC communication?
Can I write a SignalR Hub, generate a JS proxy and bind the Hub to a TCP socket?
Here is a picture: https://www.dropbox.com/s/xeaja4dos4bgvbz/SignalR_Hubs_Stackoverflow.png

Nope. SignalR is based on HTTP not TCP directly. WebSockets is the closest thing to a raw tcp socket and it has the added benefit that it works over port 80.

Related

SignalR server to server communications

I have an application that uses SignalR to broadcast data to all connected clients. Its a .NET6 Blazor Wasm hosted web application. Now, I want the the broadcaster (which is running on the Blazor server) to connect to a data source that is outside my website, and get data from there. The source data is being broadcast via UDP on a different network.
So my question is, is it possible that my SignalR hub that is running on the Blazor server connects to another SignalR hub running on a different machine in a different network and get real time data from it? Or may be I can run a SignalR client as well on my Blazor server and then connect to a machine on another network? Can I run a SignalR hub on the UDP source machine to which my Blazor server SignalR hub or client can connect? From what I have read, SignalR only runs on a website. Or is it that SignalR is not suitable for this kind of server to server data feeds?

Own IOT platform using websockets

I am doing an IOT platform for my final year project at university, the concept is to link an IoT device with the Platform using WebSockets. My Websocket is working very well and I can send message from server to client.
But I don't know how to connect two clients to send messages to others via websocket server.
I can send message between website and server and also between my esp8266 and server.
how can I connect my arduino to the website?
Thank you
A WebSocket is basically a persistent connection between a client and
server.
In order for devices to talk with each other they first need to pass
by the server.
The server simply redirects the messages to the client that needs to
receive it.
Generally you'd have the WebSocket server in your backend.
Your frontend will be a WebSocket client.
Your device will be another WebSocket client.

Running a federated RabbitMQ on port 80

Our client has a requirement that a web server can only have port 80 and 443 open, both public and internal facing, but our application would benefit from using queuing on the inside.
Is it possible to run RabbitMQ over port 80?
Update
The setup is as follows.
We have a public facing API server which calls various back end systems.
In between the API server and the back end servers there is another layer which in most cases just works like a proxy.
Some of the back end systems, as well as the proxy layer, go up and down intermittently.
What I would like to do is have a queue on the API server, a queue in the proxy layer and a queue in the back end layer.
These queues would be federated so that a messages placed on the queue on the API server would be forwarded all the way down to the back end servers (queuing is needed for inserts and updates only).
One way is using Web-Stomp plugin and Sock.js, using nginx as proxy.
Another way - node.js callback for some sending messages, handling events and create messages with node.js.
Server side works with RabbitMQ by localhost connect with default port.
Third way is using subdomain with another IP adress.

Why using web services over remote connections?

Can we just use remote connections when we need to connect to remote database on remote server?
or we should use web services and what is the web service Architecture? is it differs when we use Lan or internet?
To put it simple: web service are based on remote connections (TCP-connections) between server and client. However web services use standard formats to code and transport requests and answers. There are standard libraries for every platform, taking care of the communications.
The benefit of using web service over remote connections is that you do not have to bother with sockets, coding messages into streams and all the puzzle things. Instead you concentrate on your business logic.
In case of internet, you will need to access a proxy server to access internet. Almost every organisation has proxy server for HTTP and HTTPS, they can be used for web services directly. If you use your own remote connections, you may not able to configure the proxy server to let them through.

SignalR Persistent Connection Between MVC Server and a Windows Service?

I have a use case where we will have an ASP.NET MVC Server Application but it needs to talk over a persistent connection to a Windows service. It doesn't look like SignalR does this as it really wants talk Server to JavaScript browsers but I did notice .NET desktop libraries. Can it talk from a server to a Windows server? If not, is there a recommended way, TCP/IP or HTTP to have a persistent connection between the two? NetTcpBinding in WCF?
Yes, there is a SignalR client library for .NET that you can use in any old .NET app to talk to a SignalR server just like you can from JavaScript.
While there is a WebSockets binding for WCF, there is no binding that actually talks native SignalR which adds its own message framing on top of raw web sockets. So, while possible, it doesn't exist today and I wouldn't hold my breath for it ever being created.
Why not simply have a queue using RabbitMQ. And anytime the web need to talk to window service, it push a message into the queue while the window service listen to the queue

Resources