tera-proxy-sls
v0.2.0
Published
Adds servers to the EME TERA server list.
Downloads
2
Readme
tera-proxy-sls
Spawns an HTTP proxy server to modify a TERA server list.
Example:
const SlsProxy = require('sls');
const proxy = new SlsProxy({
customServers: {
4009: { name: 'Celestial Chills', port: 9999, overwrite: false },
},
});
proxy.listen('127.0.0.1', () => console.log('listening'));
process.on('SIGHUP', () => proxy.close());
Server URLs:
Each region has its own server list. They are as follows:
- EU: http://web-sls.tera.gameforge.com:4566/servers/list.uk
- JP: http://tera.pmang.jp/game_launcher/server_list.xml
- KR: http://tera.nexon.com/launcher/sls/servers/list.xml
- NA: http://sls.service.enmasse.com:8080/servers/list.en
- RU: http://launcher.tera-online.ru/launcher/sls/
- TW: http://tera.mangot5.com/game/tera/serverList.xml
API Reference:
new SlsProxy(opts)
Constructor with the following allowed options, all optional:
url
: The URL of the target server list. Default:http://sls.service.enmasse.com:8080/servers/list.en
hostname
: Overrides the hostname for the parsedurl
if given.port
: Overrides the port for the parsedurl
if given.pathname
: Overrides the pathname for the parsedurl
if given. Can be a string for a single path, or an array for multiple paths.address
: If not provided, a DNS lookup will be performed on thehostname
. All requests will be proxied to the resolved address, or this one if given.customServers
: An object of custom servers. SeesetServers
below for details.
The HTTP proxy server will run on the same port as specified here. Note that the target server list and the proxy server list must use the same port.
proxy.setServers(servers)
Sets the custom server object where servers
is a mapping of server IDs with custom options.
For each server, valid options are:
ip
: The IP to point to for the custom server. Default:127.0.0.1
port
: The port for the custom server. Default:null
(no change)name
: The name to use for this server in the list. Default:null
(no change)keepOriginal
: Iftrue
, this custom server will show up as an extra server instead of replacing the original one in the list. Default:false
If keepOriginal
is true
for a server, then the crowdness
for the new server will have a sort value of 0
to give it priority over the old server when TERA selects which one to automatically log into.
proxy.fetch([index], callback)
Fetches a map of server IDs and simplified properties from the official list.
callback
receives two parameters:
err
: The error, ornull
if none.servers
: An object mapping IDs to objects containing server metadata.
Example result:
{
"4004": {
"id": "4004",
"ip": "208.67.49.28",
"port": "10001",
"name": "Tempest Reach"
},
"4009": {
"id": "4009",
"ip": "208.67.49.68",
"port": "10001",
"name": "Celestial Hills - Roleplay"
},
"4012": {
"id": "4012",
"ip": "208.67.49.92",
"port": "10001",
"name": "Mount Tyrannas"
}
}
proxy.listen(hostname, callback)
Starts an HTTP server listening on hostname
, using callback
as the handler for the listening
event (see net.Server#listening). If there was an error, it will be passed as the first parameter to callback
.
proxy.close()
Closes the proxy server.