mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-28 23:19:33 +00:00
Add getHttpHost guessing the ntopng url host
This commit is contained in:
parent
73e6862d6a
commit
95c4ee97fe
1 changed files with 19 additions and 0 deletions
|
|
@ -1188,6 +1188,25 @@ function getHttpUrlPrefix()
|
|||
end
|
||||
end
|
||||
|
||||
-- ###########################################
|
||||
|
||||
function getHttpHost()
|
||||
local ntopng_info = ntop.getInfo()
|
||||
local ntopng_host_info = ntop.getHostInformation()
|
||||
|
||||
local ntopng_host_ip = ntopng_host_info.ip or '127.0.0.1'
|
||||
|
||||
local ntopng_protocol = "http://"
|
||||
local ntopng_port = ntopng_info.http_port
|
||||
|
||||
if ntopng_info.https_port and tonumber(ntopng_info.https_port) ~= 0 then
|
||||
ntopng_protocol = "https://"
|
||||
ntopng_port = ntopng_info.https_port
|
||||
end
|
||||
|
||||
return ntopng_protocol .. ntopng_host_ip .. ":" .. ntopng_port
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
||||
function getPoolName(pool_id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue