There are currently 5 players online.
 
Warsow

 
 

FrontendHTTPServer

1. General information back to top


Starting with 1.5 release Warsow got its own builtin HTTP server to serve various AJAX game requests and also .pk3 and demo files to clients. By default, the HTTP server component runs on 44444 TCP port. Although is is capable of serving static content to game clients such as maps, textures and models, it is still recommended that you put it behind a frontend server such as nginx. That will free CPU time for the gameplay component of Warsow's server process.
For this to work properly, the game needs to be aware of the frontend server. This is where several console variables come in handy (please note that this only applies to Warsow versions >= 1.2b):
  • sv_http_upstream_baseurl - the URL which your frontend/proxy server runs on. Game clients will make requests to this base url, appending either /game or /files to the path, depending on the type of the request.
  • sv_http_upstream_ip - IP address of the frontend server.
  • sv_http_upstream_realip_header - name of the HTTP header which contains remote IP address of the original requestor. This needs to be set properly by your frontend/proxy server. Note that only requests coming from the host with IP address matching sv_http_upstream_ip will be considered.

2. Example back to top


Here's a sample nginx config section that runs on port 8080, serves static .pk3 and demo content to clients and proxies all /game requests to the actual Warsow HTTP server running on port 44444.

server {
listen 8080;
server_name warsow.example.com;
location /game/ {
proxy_pass http://127.0.0.1:44444/game/;
proxy_http_version 1.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Connection "";
}
rewrite ^/files/(.*)$ /$1 last;
location ~ \.(pk3|wdz?\d+)$ {
root /home/warsow/;
try_files /warsow_1.5/$uri /.warsow-1.5/$uri =404;
}
}

And here's the dedicated server config counterpart:

set sv_http_upstream_ip "127.0.0.1"
set sv_http_ip "127.0.0.1"
set sv_http_ipv6 "::1"
set sv_http_upstream_baseurl "http://warsow.example.com:8080"
set sv_http_upstream_realip_header "X-Real-IP"





RSSRSSRSSRSS

Copyright © 2016 warsow.gg

Warsow in social media