Jump to content

[1.12.5] HTTPGateway

Anthony P

Recommended Posts


Latest release: HTTPGateway Release Page

What is it?

This is a server only mod for the game Vintage Story. You must have purchased the game to use this mod. While this mod is server only, it will still work for single player games since the game runs a server locally.

This mod creates a webserver using the EmbedIO library, enabling you to host webpages, images, or other static files. A basic API has been implemented as well, allowing you to fetch data from the game server to your site. Additionally, a websocket endpoint has been created, allowing you to connect and stream the game logs to your site. Included is basic server monitoring site built with Gridsome, a Vue static site generator. You can choose to replace all files in the Web directory if you would like to host your own site.

How do I install it?

Until the game supports automatic importing of external references for mods, you will have to manually copy a few files as part of installation.

  1. Extract your mod zip file, the extra files we need are located inside.
  2. Copy the contents of the /Lib/ folder to the /Lib/ folder in your game directory, alongside the game executable.
  3. Copy the /Web/ directory to your data folder. This will be a new directory, and will be where you can add files to be hosted by the webserver.


This mod relies on 3rd party software and opens up HTTP access to the server hosting your game. There are always security risks involved. This mod may also cause performance issues with your game under heavy load, please use caution and consider using a reverse proxy such as NGINX if you plan on allowing public access to the site.


The default port the server runs on is 80, enabling you to directly visit your server address in a web browser to open the hosted site. If you cannot bind to port 80, you can edit the file httpgateway-port.txt located in your vintage story game directory. You must load the mod at least once for this file to appear. The file should contain one line with the desired port. After changing the file, restart your server for the changes to apply.

How do I use it?

Once the mod is installed and hosting, you can visit the default site by visiting the bound address in your web browser. If you would like to develop your own site, there is a built in authentication supplying a jwt token, and several endpoints providing useful information once you are authorized. The authorization is based on a 6-character code challenge that you can generate in game with the command /httpgateway code.

  • POST/api/login?code=<6-character-code> returns { "_auth": "<jwt>" }
  • GET/api/server with header: _auth=<jwt> returns <JSON of IServerAPI> IServerAPI
  • ws:///ws/<jwt> opens websocket connection which streams server logs in format: { "type": <logType>, "data": <logMessage> }


  • Fetch existing logs on ServerLogs connect
  • Better realtime updates, probably over websocket
  • More endpoints for more stuff
  • Interact with server chat over websocket

Roadmap Ideas

  • Add DB for more flexible persistance
  • Full server management (over websocket and endpoint)
  • Role based permissions (only admin for now)
  • Reverse proxy support


Edited by Anthony P
Update release
Link to comment
Share on other sites

Added some relevant pictures.  If you have any issues with the mod not loading, double check your server log for any error messages.  Most likely you need to double check that you've moved all the files from /Lib into the game /Lib folder.  You may also need to remove the /Lib file from the zip archive.  If this is a consistent issue, I'll split the files so you can just drop them where they need to go.

Screen Shot 2020-03-04 at 3.28.12 PM.png

Screen Shot 2020-03-04 at 3.29.07 PM.png

Screen Shot 2020-03-04 at 4.42.14 PM.png

Screen Shot 2020-03-04 at 4.43.16 PM.png

Screen Shot 2020-03-04 at 4.47.43 PM.png

Screen Shot 2020-03-04 at 4.48.06 PM.png

Link to comment
Share on other sites

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.