Added the method to bind the GUI to an IP other than the loopback

Fixed bug that, in case o binding address, was not binding the alternate port (but jsut the main one) to the specified address
This commit is contained in:
Luca Deri 2017-05-28 22:43:54 +02:00
parent ae0556b874
commit 7cdff93fef
4 changed files with 11 additions and 5 deletions

View file

@ -720,7 +720,10 @@ HTTPserver::HTTPserver(const char *_docs_dir, const char *_scripts_dir) {
char tmp[16];
if(ntop->getPrefs()->get_alt_http_port() != 0)
snprintf(tmp, sizeof(tmp), ",%d", ntop->getPrefs()->get_alt_http_port());
snprintf(tmp, sizeof(tmp), ",%s%s%d",
http_binding_addr,
(http_binding_addr[0] == '\0') ? "" : ":",
ntop->getPrefs()->get_alt_http_port());
else
tmp[0] = '\0';