Reputation:
I'd like to enable WebSocket and use it with SignalR. I have an instance which is my API and an other instance which my front app (AngularJS). Should I enable WebSocket on both sides (API and front) or only API side?
The reason behind is that I don't want to pay for two Standard Azure Plan (which is the only way to have unlimited WebSocket connections).
Upvotes: 0
Views: 384
Reputation: 69
Websocket is a protocol defining a full duplex communication channel. In order to have an application that leverages websocket work, the browser (front end) and server (back end) must leverage this protocol.
When the browser (or communication initiator) makes a connection to the host using websocket, the initial handshake is HTTP-like over TCP, and the connection type is set to "upgrade" and the upgrade field is set to "websocket". If the responding server doesn't understand the "upgrade" request, the connection will fail.
In some cases this upgrade request can be used to fall back to traditional long-polling over HTTP if the upgrade to websocket is not available.
More information can be found on wikipedia and HTML5 tutorials page.
Upvotes: 1