SignalR makes possible to have two side connectivity with web server to get/send (streaming) data in real-time. For example, you can get quotes, margin updates of your MT4 clients, online users list, open orders at real time as it happen in MT4. Once you get subscribed to whatever you need you would get updates, no need to ask web server about new portion of data every time.
Here you can get working examples. Simply open source code of any page below and get client side code which demonstrates basic while negotiating with SignalR endpoint.
This example shows data coming from server every second - current server time. No authentication needed.
https://MyWebAPI.com/DemoSignalR/Test - This example shows how you can get real-time date from WebAPI host server.
https://MyWebAPI.com/DemoSignalR/MT4 - Be aware, you need to adjust page source code (to make it work) to whatever you have for your installation (client_id, client_secret, tradeplatform_id, etc). Get page source, adjust settings and run the page.
How to use
Add links to required libraries within your page's header:
Then create connection to SignalR endpoint:
To connect just call:
You need an authentication token obtained from authentication server (auth.cplugin.net). Once you get a token, provide it to SignalR client through accessTokenFactory() function
There are few hubs available to work with. Test and MT4. More details about each one you can find in corresponding section.