WebSocket Server

FRM provides a WebSocket server that can be configured on a port of your choosing (Default: 8081). This can be modified by either modifying the HTTP_Root value in %SatisfactoryRootFolder%\FactoryGame\Configs\FicsitRemoteMonitoring\WebSockets.cfg (Config File Method), or by Satisfactory’s Main Menu > Mods > FicsitRemoteMonitoring > WebSocket Port (Game UI Method).

Accessing the websocket server can be done via a browser that is using a WebSockets Tester (I recommend https://www.piesocket.com/websocket-tester). The default WebSocket connection is ws://<IP Address>:8081/

The websocket server, by default, is not activated until the appropriate chat command is provided. You may also have the websocket server auto-start by enabling the Autostart WebSocket Server in Game UI Method, or changing the WebSocket_Autostart in the Config File Method to true.

There are two methods of receiving information. A one time request, or a subscription/publishing.

One-Time Request:
This is a simple call for information, and not a constant reply. Useful for testing or controlling the polling rate.

Subscription/Publishing:
A request is needed to be made to "subscribe" to an API function. Afterwards, the mod will then "publish" the output, of the subscribed APIs, to the connecting client as defined by the WebSocket Delay.

Chat Commands:

/frmsocket start - Starts WebSocket Server
/frmsocket stop - Stops WebSocket Server

API Endpoints:
There are currently several API Endpoints configured, but more are planned. Arguments are reserved for future use and are not currently implemented.

API Endpoint Usage:

Usage Example:

  • One Time Client Request to Server:

    {
       "command":"API_Name",
    }
  • Subscription Request to Server:

    {
       "subscribe":"API_Name",
    }
  • Un-subscription Request to Server:

    {
       "unsubscribe":"API_Name",
    }

Live use case: (Example is API Endpoint: getPower)

  • Client Request to Server:

    {
       "command":"getPower"
    }
  • Server Return to Client:

    [{
          "CircuitID":0,
          "PowerCapacity":9.0,
          "PowerProduction":9.0,
          "PowerConsumed":9.0,
          "PowerMaxConsumed":9.0,
          "BatteryDifferential":0.0,
          "BatteryPercent":0.0,
          "BatteryCapacity":0,
          "BatteryTimeEmpty":"00:00:00",
          "BatteryTimeFull":"00:00:00",
          "FuseTriggered":false
    },
    {
          "CircuitID":1,
          "PowerCapacity":9.0,
          "PowerProduction":9.0,
          "PowerConsumed":9.0,
          "PowerMaxConsumed":9.0,
          "BatteryDifferential":0.0,
          "BatteryPercent":0.0,
          "BatteryCapacity":0,
          "BatteryTimeEmpty":"00:00:00",
          "BatteryTimeFull":"00:00:00",
          "FuseTriggered":false
    }]