A Reverse Proxy Server for the SPA Server.
Use the build.bat
script included with the source code.
go install github.com/vault-thirteen/SPA/cmd/proxy@latest
proxy.exe <path-to-configuration-file>
proxy.exe
Example:
proxy.exe "settings.txt"
proxy.exe
Notes:
If the path to a configuration file is omitted, the default one is used.
Default name of the configuration file is settings.txt
.
Format of the settings' file for a server is quite simple. It uses line breaks as a separator between parameters. Described below are meanings of each line.
- Server's hostname.
- Server's listen port.
- Work mode: HTTP or HTTPS.
- Path to the certificate file for the HTTPS work mode.
- Path to the key file for the HTTPS work mode.
- TTL of served files, i.e. value of the
max-age
field of theCache-Control
HTTP header. - Allowed origin for HTTP CORS, i.e. value of the
Access-Control-Allow-Origin
HTTP header. - Address of the target server.
- Path to the IPARC database file.
- Boolean flag showing that unknown countries should be allowed.
- Comma separated list of two-letter codes of forbidden countries.
- Boolean flag showing that server is the main proxy server.
- The built-in reverse proxy server automatically sets the
X-Forwarded-For
HTTP header to contain the client's IP address. - Client's country code is written to the
X-ClientCountryCode
HTTP header.