mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-04-27 00:56:30 +00:00
chore: limit API to only listen on localhost (#1740)
This commit is contained in:
parent
306d959a83
commit
566791e647
@ -150,11 +150,12 @@ ChatWebAPI::~ChatWebAPI() {
|
|||||||
|
|
||||||
bool ChatWebAPI::Startup() {
|
bool ChatWebAPI::Startup() {
|
||||||
// Make listen address
|
// Make listen address
|
||||||
std::string listen_ip = Game::config->GetValue("web_server_listen_ip");
|
// std::string listen_ip = Game::config->GetValue("web_server_listen_ip");
|
||||||
if (listen_ip == "localhost") listen_ip = "127.0.0.1";
|
// if (listen_ip == "localhost") listen_ip = "127.0.0.1";
|
||||||
|
|
||||||
const std::string& listen_port = Game::config->GetValue("web_server_listen_port");
|
const std::string& listen_port = Game::config->GetValue("web_server_listen_port");
|
||||||
const std::string& listen_address = "http://" + listen_ip + ":" + listen_port;
|
// const std::string& listen_address = "http://" + listen_ip + ":" + listen_port;
|
||||||
|
const std::string& listen_address = "http://localhost:" + listen_port;
|
||||||
LOG("Starting web server on %s", listen_address.c_str());
|
LOG("Starting web server on %s", listen_address.c_str());
|
||||||
|
|
||||||
// Create HTTP listener
|
// Create HTTP listener
|
||||||
|
@ -9,5 +9,6 @@ max_number_of_friends=50
|
|||||||
|
|
||||||
web_server_enabled=0
|
web_server_enabled=0
|
||||||
|
|
||||||
web_server_listen_ip=127.0.0.1
|
# Unused for now
|
||||||
|
# web_server_listen_ip=127.0.0.1
|
||||||
web_server_listen_port=2005
|
web_server_listen_port=2005
|
||||||
|
Loading…
x
Reference in New Issue
Block a user