A cross-platform JSON proxy for the GB railway Live Departure Boards SOAP API
This project is treeware! If you found it useful then please plant a tree for me.
Huxley 2 is a CORS enabled cross-platform JSON ReST proxy for the GB NRE LDB WCF SOAP XML API (called Darwin). It supports both the Public Version (PV) and the Staff Version (SV). It's built with ASP.NET Core LTS, C# 8.0 and lots of abbreviations!
The primary purpose of Huxley 2 is to allow easy use of the LDB API from browser-based client-side PWAs made with JavaScript or TypeScript. Additionally, it opens up the Windows enterprise API to agile developers on macOS and Linux.
Check out the live demo server for API documentation and to give it a try.
The demo server comes with zero guarantees of uptime. It can (and regularly does) go down or break.
There are detailed instructions on how to host your own instance on Azure in this blog post.
- Ensure you have Docker and Docker Compose installed
- Create an
.env
file in theHuxley2
directory with the access tokens. You can delete the ones you're not using. Example:
ACCESS_TOKEN=abcde12345
STAFF_ACCESS_TOKEN=abcde12345
CLIENT_ACCESS_TOKEN=abcde12345
- Run
docker-compose up
- The app should be available at
localhost:8081
If you need to regenerate the station codes CSV file in this repo then you can do so easily with jq
(and curl
) using an instance that has access to the staff API (and has been restarted recently). On Linux, you can install simply with your package manager, e.g. sudo apt install jq
(on Ubuntu/Debian).
For example, using the Huxley 2 demo instance you can run this one-liner:
curl --silent https://huxley2.azurewebsites.net/crs | jq -r '(.[0] | keys_unsorted) as $keys | $keys, map([.[ $keys[] ]])[] | @csv' > station_codes.csv
If using a local server with a self-signed certificate:
curl --silent --insecure https://localhost:5001/crs | jq -r '(.[0] | keys_unsorted) as $keys | $keys, map([.[ $keys[] ]])[] | @csv' > station_codes.csv
Licensed under the EUPL-1.2-or-later.
The EUPL covers distribution through a network or SaaS (like a compatible and interoperable AGPL).