-
Notifications
You must be signed in to change notification settings - Fork 91
Starting up server compatible with web & native versions
You can use docker image to host vangers server.
- You should build Vangers server (see below)
- You should install websockify
- You should have certificate for your domain (cer & key files). Web version could connect only by secure
wss://
protocol
It’s straightforward, it can be built with game it self:
git checkout https://github.com/KranX/Vangers
cd Vangers
mkdir build
cd build
cmake ..
make vangers_server
Now you should have server executable vangers_server
Websockify is a python program that can turn default vangers_server to a web socket server. Installing it really depends on your system. Official install guide
First, you need to run ./vangers_server
. It will start a server with a default config which native clients can use. By default it will start on 2197
port.
Next, you need to start websockify with certificate and correct port mapping. For example, if your domain is van.net
then command will be:
websockify --cert vang.net.cer --key van.net.key van.net:2198 van.net:2197
Where van.net.cer
and van.net.key
are certificate files that are used for https connections on your domain.
Take attention that you should open ports 2197 and 2198, to allow native and web clients to connect. For web version you must use a port that is bigger on 1, e.g. if your native port is 2197 then web port must be 2198, if your native port is 3030 then web port must be 3031 and so on.
These two programs should be work together all time.
Just set the correct domain name in game options and it will work both for native and web clients.
IMPORTANT in game config you should only use native port 2197
even if you play from browser, it will be increased by 1 automatically.