The website and the game server talk to each other through START's Website API gateway. This is the part where errors occur most often during setup, especially when the website is on rented hosting. This page explains everything you need to configure on both sides.

How it works

  • The website sends POST http://IP:port/api/v1 to START. Each command carries an HMAC-SHA256 signature calculated with the connection Key, along with a timestamp and a one-time code (nonce), so a captured command cannot be replayed. The command content is encrypted, and START's reply is also signed so the website knows it is really talking to START.
  • START only accepts commands from IPs in the allowed list. Unknown IPs are refused (and logged).
  • If the clocks on the two sides differ by more than 120 seconds, START returns the error clock.
  • START only accepts commands while the START license is valid and the account has purchased the Website package. Otherwise it returns the error license_inactive.

Enable the API gateway in START

START > Website Management > Connection (the Web Hosting (connect to START) page):

Field Meaning
Enable API gateway for Website Tick so START opens the port. Key [Website] Enabled in START.ini
Port From 1 to 65535, default 44480 (key [Website] Port)
Connection Key (paste into Hosting) 64 hex characters (0-9, a-f). Use the Copy button to copy it and the Generate new button to change the Key (the old Key becomes invalid once you save)
START API address (Hosting calls this) The address to enter in the website, in the form http://IP:port/api/v1. START suggests it automatically from this machine's IP; if the machine is behind a router, replace it with the public IP or a domain name
Website address (Hosting) Your website address, for example https://your-domain.com. START uses it to automatically allow the IP of this domain and to run the two-way connection test
Additional Hosting IPs (IP / domain) IPs / domains to allow in addition to the IP of the Website address. Enter several values if needed
Website license Shows Activated or Not purchased
Status API gateway: Open (port ...) / Off / No Key yet / Cannot open port; number of commands today (with the number of errors); last call

After making changes, click Save. The Key entries and the SQL password are encrypted in START.ini and cannot be read by hand.

Allowed IPs

START only answers the website if the calling IP is in the list. The list consists of: the IP of the domain in the Website address (Hosting) field + the entries in the Additional Hosting IPs field.

The hosting's outgoing IP may differ from the domain's IP. Many hosts use one IP to serve the web (the domain's IP) and a different IP for the website's outgoing calls. START must allow the outgoing IP. If only the domain IP is listed, START will refuse the request.

How to find the outgoing IP:

  1. Try the installation, or click the connection test once, so the website calls START.
  2. Open the Log\Website\Gate folder next to START.exe and open today's log file (YYYY-MM-DD.log). The Open log folder button in START opens the Website log folder directly.
  3. Find the line refused <IP> (not a hosting IP - add it to Allowed IPs if this is your hosting). <IP> is the hosting's outgoing IP.
  4. Add that IP to Additional Hosting IPs in START, then click Save. Try again.

Each unknown IP is logged at most once every 10 minutes so the log does not overflow. You can ask your hosting provider for the outgoing IP, but START's log is the most reliable way.

If the website is on the same machine as START: you can use the address 127.0.0.1:port, or the machine's LAN IP (in that case add that LAN IP to the allowed list, as the TswSetup installer instructs). [TO VERIFY: whether START always accepts 127.0.0.1 without it being added to the list; we only saw START log "only 127.0.0.1 can call" when no hosting IP is set]

Open ports on the game server

  1. Router / modem: NAT (port forward) START's API port (for example 44480) to the game server's LAN IP.
  2. Windows Firewall: START has an API gateway protection feature (START > Website Management > Protection & Logs). When START runs with Administrator rights, it automatically creates a firewall rule so the API port is open only to IPs in the allowed list; if there are no IPs yet, the port is closed and only 127.0.0.1 can call it. Packets from unknown IPs are dropped by Windows before they reach START. If START is not run as Administrator, it reports Cannot write firewall rule: run START as Administrator or open the port yourself.
  3. Do not open the API port to the whole Internet on your own.

Hosting blocks outgoing ports

Many cPanel hosts only let websites call out on a few common ports. If the website reports it cannot connect even though everything else is correct, change the API Port in START to a port your provider allows (from experience, port 3306 is usually open), NAT that port on the router, then update the game server address in the website (APP/Config/api.php, key url). Do not use 3306 if the game server is running MySQL on that port (SQL Server uses 1433, so there is no conflict).

Website-side configuration: APP/Config/api.php

The installer page writes this file automatically. Edit it by hand when you change the Key, the port, or the game server IP:

Key Value Default (written by the installer) Meaning
url Full URL, ending in /api/v1 from the Game server address field START's API address
secret 64 hex characters from the Connection Key field The connection Key, must match the Key in START
timeout number of seconds 15 How long to wait for START to reply
proxy_header server variable name, or leave empty empty If the website is behind Cloudflare, set HTTP_CF_CONNECTING_IP so START sees the player's real IP
servers array keyed by server code none Only used when running multiple servers, written automatically by Admin > Game servers

Example:

<?php
return array (
  'url' => 'http://123.45.67.89:44480/api/v1',
  'secret' => '0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef',
  'timeout' => 15,
  'proxy_header' => '',
);
This file contains the Key. Do not share it or put it anywhere public.

Test the connection

START > Website Management > Connection > enter the Website address (Hosting) > click Test connection. START tests both directions: START calls the website (/api/start-link), then the website calls START back. The result shows two lines, START → Hosting and Hosting → START, along with the address the Hosting points to and the hosting's PHP version.

Result Meaning and how to fix
OK (n ms) That direction works
Cannot connect (wrong address / Hosting is off) The website address is wrong or the website is not running
Hosting has not been updated to a START-compatible version (HTTP n) The website package is too old, update the website
Wrong Key (the Key in Hosting differs from START) Copy the Key into APP/Config/api.php again
The clocks on the two machines differ too much Correct the time (maximum difference 120 seconds)
Hosting cannot call START (...) - open port n on the firewall / router The website → START direction is blocked: open the port, check the allowed IPs, and check whether the hosting blocks outgoing ports
Hosting does not point to START: fix url in APP/Config/api.php The url in the website differs from START's API address

Each test is also appended to the Log\Website\Gate log.

Common API error codes

During setup or while the website is running, the codes below tell you why START refused a request:

Code Cause
forbidden_ip The calling IP is not in the allowed list
bad_signature Wrong Key. If a wrong signature is sent many times, that IP is temporarily blocked (the log shows "IP blocked")
clock Clock difference is over 120 seconds
not_paired START has no Key yet: go to Connection, generate a Key and click Save
license_inactive START is not activated or the Website package has not been purchased
api_disabled The API gateway is turned off in START
paused START's read-only mode is on (write commands are blocked) or the API is paused
rate_limited Too many commands per minute from one IP; raise the limit on the API gateway protection page if needed
feature_disabled That feature is turned off in START > Website Management > Features; the website automatically hides the corresponding page
network_error The website cannot reach START: check the IP, port, firewall, router, and whether the hosting allows calls out on that port

Protection and read-only mode

The API gateway protection page in START lets you:

  • Turn on Read-only: players can still view the website, but all write commands (currency, items, passwords, website administration) are blocked. Use it when you suspect the hosting has been compromised.
  • Rotate key now: the old Key becomes invalid immediately, and the website loses its connection until you paste the new Key into api.php.
  • Adjust the anti-attack limits: commands per minute per hosting IP, number of wrong signatures before an IP is blocked, and how long an IP stays blocked.
  • View the list of blocked IPs and unblock them.

See also the START tools page for the full list of START settings.