Implements the ability to listen on custom ipv4 and ipv6 addresses and ports

ntopng can now be bound to any custom ipv4 or ipv6 address, and
not only the ANY_ADDR or loopback.

Implements #391
This commit is contained in:
Simone Mainardi 2016-03-23 00:59:38 +01:00
parent 417e909236
commit b6eb2bc36c
3 changed files with 53 additions and 17 deletions

View file

@ -416,7 +416,7 @@ static int handle_lua_request(struct mg_connection *conn) {
HTTPserver::HTTPserver(u_int16_t _port, const char *_docs_dir, const char *_scripts_dir) {
struct mg_callbacks callbacks;
static char ports[32], ssl_cert_path[MAX_PATH] = { 0 };
static char ports[256], ssl_cert_path[MAX_PATH] = { 0 };
char *_a = NULL, *_b = NULL;
const char *http_binding_addr = ntop->getPrefs()->get_http_binding_address();
const char *https_binding_addr = ntop->getPrefs()->get_https_binding_address();