diff options
Diffstat (limited to 'src/zenhttp/httpserver.cpp')
| -rw-r--r-- | src/zenhttp/httpserver.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/zenhttp/httpserver.cpp b/src/zenhttp/httpserver.cpp index d6dfb347f..3cefa0ad8 100644 --- a/src/zenhttp/httpserver.cpp +++ b/src/zenhttp/httpserver.cpp @@ -1016,19 +1016,26 @@ int HttpServer::Initialize(int BasePort, std::filesystem::path DataDir) { m_EffectivePort = OnInitialize(BasePort, std::move(DataDir)); + m_ExternalHost = OnGetExternalHost(); return m_EffectivePort; } std::string +HttpServer::OnGetExternalHost() const +{ + return GetMachineName(); +} + +std::string HttpServer::GetServiceUri(const HttpService* Service) const { if (Service) { - return fmt::format("http://{}:{}{}", GetMachineName(), m_EffectivePort, Service->BaseUri()); + return fmt::format("http://{}:{}{}", m_ExternalHost, m_EffectivePort, Service->BaseUri()); } else { - return fmt::format("http://{}:{}", GetMachineName(), m_EffectivePort); + return fmt::format("http://{}:{}", m_ExternalHost, m_EffectivePort); } } |