A mobile friendly JSON REST proxy for the GB railway Live Departure Boards SOAP API.
Forked from the Huxley2 project
Note: Huxley 2 is considered feature-complete and will only be updated to fix bugs or move to a new .NET LTS version.
On Rails adds UK national rail stations locations API on top of the Huxley2 Proxy service
The Huxley2 Proxy service connects to the NRE Darwin feed which is an aggregated real-time train feed for all operators in the UK.
Station Data is downloaded from Naptan and other sources where the Naptan data isn't up to date
Check out the live server for API documentation.
A mobile client SDK is also available for accessing station locations via the proxy.
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. - Run
docker-compose up
- The app should be available at
localhost:8081
Example .env
file:
ACCESS_TOKEN=abcde12345
STAFF_ACCESS_TOKEN=abcde12345
CLIENT_ACCESS_TOKEN=abcde12345
To rebuild use docker-compose build
or docker-compose up --build
.
If you want to run the container in the background you can run docker-compose up --detach
If you would like the docker container to reboot upon restart on the host machine you can uncomment restart: always
in the docker-compose.yml file and make sure the docker service is set to start upon bootup.
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
If you regenerated the station codes CSV file on your own instance, change StationCodesCsvUrl
in Huxley2/appsettings.json
to the location of your CSV file.
Licensed under the EUPL-1.2-or-later.
The EUPL covers distribution through a network or SaaS (like a compatible and interoperable AGPL).