Skip to content

SignalR delivery

SignalR is a library for enabling real-time communication between servers and clients in web applications. It allows data to be pushed instantly from the server to the client without requiring constant polling.

In OrbitSailor, SignalR is offered as one of the data delivery methods. It can be used to provide real-time data to Graphical User Interfaces, enabling dynamic and instantaneous display of vessel positions and related updates.

Setting up the delivery method

To setup the SignalR delivery method follow the steps:

  1. Login to the OrbitSailor Configuration Dashboard with admin rights
  2. Go to the Service Configuration
  3. Navigate to DELIVERY CONFIGURATION tab
  4. Click on ADD DELIVERY CONFIGURATION
  5. Enter a new name in the Endpoint Name field
  6. Select SignalR Push
  7. Click on GENERATE API KEY
  8. A new code will be presented below

SignalR new code

  1. Copy this code by clicking on COPY TO CLIPBOARD or selecting the whole code and copying it manually

INFO

This API Key is only visible during creation, please keep it in a safe place. If the API Key is lost, a new one should be generated.

Use the following URL and the API key to access the SignalR service:

https://delivery.europe1.api.aisservices.lux.space/DataDeliveryHub?apiKey=YOUR_APIKEY_HERE
  1. Optionally you can turn on a toggle switch Store Raw API Key
  2. Optionally you can customize a message by turning on a toggle switch. Go to Customize Message Format to learn more about it.
  3. Save the configuration by clicking on SAVE button

The SignalR delivery method is now set up and ready for use.

As soon as you regenerate the key and save, the previous key will be invalidated.

Using the SignalR delivery method

In your code, you must load the library (not described here), and then initialize the connection and subscribe to data delivery.

JS client example

javascript
const connection = new signalR.HubConnectionBuilder()
  .withUrl(
    "https://delivery.europe1.api.aisservices.lux.space/DataDeliveryHub?apiKey=YOUR_APIKEY_HERE"
  )
  .withAutomaticReconnect()
  .build();

connection.on("DataDelivery", (message) => {
  // handle your message here
});

// Start the connection.
connection.start();

C# client example

csharp
var connection = new HubConnectionBuilder()
    .WithUrl("https://delivery.europe1.api.aisservices.lux.space/DataDeliveryHub?apiKey=YOUR_APIKEY_HERE")
    .WithAutomaticReconnect()
    .Build();

connection.On<string>("DataDelivery", data => {
    // handle your message here
});

connection.StartAsync();