SignalRService
The Linx SignalRService incorporates the required functionality to allow for:
- SignalR and/or REST requests to your service
- JWT Authentication of those requests
- the handling of the operations that are to be executed when a request is received
- Add
SignalR plugin to your solution. - Drag
SignalRService onto the Solution Explorer panel. - Set properties for the service. (See below for details.)
- Click Edit button (Operations property).
- Add Server method (e.g. SendMessage) and Client method (e.g. ReceiveMessage) in the Operations Editor.
- Drag required functions and types onto the design canvas of an event that was created for your service when you added the Server method (e.g. SendMessage) in the previous step.
- Click Debug (on top toolbar) to test and debug your solution, or right-click on the service or service event (in the Solution Explorer), then select Debug to specifically test and debug the service.
Properties
Hub URL
SignalR hub URL, e.g.
REST requests will be allowed on
To prevent REST requests on this address, specify a REST URL.
What is a hub? SignalR uses hubs to communicate between clients and servers. Find out more here.
REST URL
Optional base URL to use for REST requests, e.g.
REST endpoints will be accessible on
If not specified, REST requests will be allowed on the hub URL.
Security
The type of security used for authentication.
Select either
When selecting JWT Authentication, provide the following:
Secret key
Secret key used to validate the JWT token.
Claims
Comma-separated list of claim names to resolve on the event input, e.g.
Operations
SignalR operation metadata.
Click the Edit button to open the SignalR
For each Operation that you add, provide the details for both the
Server method
Specify a name for the method that is executed as an event when the operation is performed.
Client method
Specify the name of the client method.
Execution type
Indicate whether the operation can be accessed via the Hub (SignalR), REST, or both.
- Select Hub if you only want to use the Hub URL to make calls on.
- If you select REST, but don't specify a REST URL, then the REST calls will be made on the Hub URL. If you select REST and you provide a REST URL, then REST calls will always be made on the REST URL.
- If you select Both, then calls can be made on both Hub and REST URL's. If no REST URL is provided, then REST calls will be made on the Hub URL.
Parameters
Add the parameters that are required by each operation.
For each Operation an
Sample
Go here for a Linx sample solution that uses SignalR to build a basic web chat application.