TSW WebSocket API

Description

This is not a standalone mod but a dependency for third-party applications

This mod adds a powerful websocket server (uWebSockets) to the game.

Developers of external applications can use this to obtain data from the game. The basic idea was developed for an external Ebula system, but I would like to create a central API for all external applications. The existing endpoints are gradually being expanded.

If you would like the websocket server to expose more data, please feel free to contact me. I will then try to provide the requested data.

Please intall the dependency (UE4SS) before installing this mod.

Important: This is a beta release of the mod. If you have any problems or suggestions for improvement, please use the comment function. You can also contact me via Discord.

How to use

After installing the game will expose a websocket server at localhost:9187.
The developer manual is available here: https://vanlueckn.github.io/tsw-websocket-docs

Known issues

  • Currently the port is hardoced to 9187

Roadmap

  • Add more useful data to expose via the server
  • Add configurable interval on subscription

License & Contributing

This mod is now open source. Everyone is allowed to participate. You can view the github repository here.

Changelog
  • Version 0.1: Initial release
  • Version 0.2: Added execution of console commands
  • Version 0.3: Added individual subscription intervals and fixed a crash

Tags: api code server ue4ss websocket

Dependencies

Needed for loading C++ and Lua Mods

Installation Instructions

The downloaded ZIP archive must be unpacked into the folder \WindowsNoEditor\TS2Prototype\Binaries\Win64\ue4ss\Mods.

If you are playing on XBox Games the Mods folder location may differ.

Files

Comments

Loading comments…

About this mod

Created
14 Jan 2025
Updated
12 May 2025
Game
Train Sim World
Type of content
Other
Train Sim World Version
Train Sim World 5