From 6b312d934085caf1add5e6081f55c9944ab01aa9 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sat, 23 May 2009 06:29:08 +0000 Subject: * Implements automatic loopback handling for standalone regions. * This /should/ make OpenSim behave properly when hosting behind a NAT router and utilizing port forwarding (but the router doesn't support Loopback) --- .../Framework/Communications/Services/HGLoginAuthService.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework/Communications/Services/HGLoginAuthService.cs') diff --git a/OpenSim/Framework/Communications/Services/HGLoginAuthService.cs b/OpenSim/Framework/Communications/Services/HGLoginAuthService.cs index 1de0d4d..0637a1e 100644 --- a/OpenSim/Framework/Communications/Services/HGLoginAuthService.cs +++ b/OpenSim/Framework/Communications/Services/HGLoginAuthService.cs @@ -279,11 +279,17 @@ namespace OpenSim.Framework.Communications.Services if (m_serversInfo.HttpUsesSSL) { - seedcap = "https://" + m_serversInfo.HttpSSLCN + ":" + regionInfo.HttpPort + capsSeedPath; + // For NAT + string host = NetworkUtil.GetHostFor(remoteClient.Address, m_serversInfo.HttpSSLCN); + + seedcap = "https://" + host + ":" + m_serversInfo.httpSSLPort + capsSeedPath; } else { - seedcap = "http://" + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort + capsSeedPath; + // For NAT + string host = NetworkUtil.GetHostFor(remoteClient.Address, regionInfo.ExternalHostName); + + seedcap = "http://" + host + ":" + m_serversInfo.HttpListenerPort + capsSeedPath; } response.SeedCapability = seedcap; -- cgit v1.1