SignalR Configuration

All SignalR requests are managed through the Socket server. There are 2 ways to deploy this depending on your preference and deployment setup. You can enable the Search API to act as the application managing this, or the Socket API can be deployed instead.

Search API (Option 1)

To deploy the Search API with the socket server capability the appSettings.json file needs to be updated. It needs the the socketServer key to be set to true in the remoteApi section. If the key isn't in this section, this will default to false.

1

Open the appSettings.json file within C:\InsightMaker\Apps\Search\api.

2

Find the remoteApi section of the file.

3

Add "socketServer": true under the certificate details.

It should be similar to the below:

"remoteApi": {
"BindAddresses": [
"0.0.0.0"
],
"RemoteAddress": "https://localhost/api",
"Port": 5003,
"AllowedOrigins": [
"*"
],
"certificate": {
"path": "C:\\elastic-certificates.p12",
"password": ""
},
"socketServer": true
}

When the web application restarts you will see the SearchAPI has been added to the configuration_registration index in Kibana.


Socket API (Option 2)

To deploy the socket server you need to create a Socket folder, update some configurations and add an IIS application.

Folder Creation

1

Go to your InsightMaker/Apps folder.

2

Create a new folder called 'Socket'.

3

Open the Socket folder.

4

Create a new folder called 'api'.

API Deployment

1

Run the following script in an admin PowerShell to deploy the Socket build assets.

$Filename = "C:\InsightMaker\Apps\socket\api";
Copy-Item -Path "$filename\appsettings.default.json" -Destination "$filename\appsettings.json" -Force;
Copy-Item -Path "$filename\log4net.default.config" -Destination "$filename\log4net.config" -Force;
Copy-Item -Path "$filename\web.default.config" -Destination "$filename\web.config" -Force;

Configuration

1

The appSettings.json file within the socket/api folder needs to be updated.

2

Change the settings in this json file to match the search api appSettings.json.

  • Elastic Certificate Path

  • Elastic Certificate Password

  • Elastic Password

  • Elastic Prefix

  • Elastic Server

  • Plugins Location

  • Remote Api Certificate Path

  • Remote API Remote Address

  • Remote API Certificate Password

  • License Key

  • License Signature

IIS Set Up

1

Go to the IIS Manager.

2

Expand your tree and right click on the API/Search application.

3

Select Add Application.

4

Alias - enter 'socket' into the alias.

5

Physical Path - Select the your new socket API folder as your path.

Ensure you select a standalone Application Pool otherwise the socket API will not be able to start up.

When the web application restarts and a request is made to the Socket API, you will see the registration added to the configuration_registration index in Kibana.

Containers

When deploying using Containers, a Socket container will be deployed. There are no further steps required.


Testing

You can test if SignalR is set up correctly using the following steps.

1

Login to your Search application.

2

The task checklist icon should be available.

3

If the icon is greyed out, inspect the page in your browser and go to the network tab.

4

You need to check for any errors around making requests to the sticky and negotiate endpoints.

Last updated