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) --- OpenSim/Grid/UserServer.Modules/UserLoginService.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'OpenSim/Grid/UserServer.Modules') diff --git a/OpenSim/Grid/UserServer.Modules/UserLoginService.cs b/OpenSim/Grid/UserServer.Modules/UserLoginService.cs index 323dc48..bb03252 100644 --- a/OpenSim/Grid/UserServer.Modules/UserLoginService.cs +++ b/OpenSim/Grid/UserServer.Modules/UserLoginService.cs @@ -270,10 +270,12 @@ namespace OpenSim.Grid.UserServer.Modules string capsPath = CapsUtil.GetRandomCapsObjectPath(); - // Take off trailing / so that the caps path isn't //CAPS/someUUID - if (regionInfo.httpServerURI.EndsWith("/")) - regionInfo.httpServerURI = regionInfo.httpServerURI.Substring(0, regionInfo.httpServerURI.Length - 1); - response.SeedCapability = regionInfo.httpServerURI + CapsUtil.GetCapsSeedPath(capsPath); + // For NAT + string host = NetworkUtil.GetHostFor(remoteClient.Address, regionInfo.ServerIP); + // TODO: This doesnt support SSL. -Adam + string serverURI = "http://" + host + ":" + regionInfo.ServerPort; + + response.SeedCapability = serverURI + CapsUtil.GetCapsSeedPath(capsPath); // Notify the target of an incoming user m_log.InfoFormat( -- cgit v1.1