diff options
author | Adam Frisby | 2009-05-23 06:29:08 +0000 |
---|---|---|
committer | Adam Frisby | 2009-05-23 06:29:08 +0000 |
commit | 6b312d934085caf1add5e6081f55c9944ab01aa9 (patch) | |
tree | ffe59622f1e810479a79b8865355b3a0ce909997 /OpenSim | |
parent | * Pipes IPEndPoint through all Login methods, including LLSD/OSD login paths. (diff) | |
download | opensim-SC-6b312d934085caf1add5e6081f55c9944ab01aa9.zip opensim-SC-6b312d934085caf1add5e6081f55c9944ab01aa9.tar.gz opensim-SC-6b312d934085caf1add5e6081f55c9944ab01aa9.tar.bz2 opensim-SC-6b312d934085caf1add5e6081f55c9944ab01aa9.tar.xz |
* 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)
Diffstat (limited to 'OpenSim')
4 files changed, 44 insertions, 15 deletions
diff --git a/OpenSim/Client/Linden/LLStandaloneLoginService.cs b/OpenSim/Client/Linden/LLStandaloneLoginService.cs index 73cc7a3..ea3a74a 100644 --- a/OpenSim/Client/Linden/LLStandaloneLoginService.cs +++ b/OpenSim/Client/Linden/LLStandaloneLoginService.cs | |||
@@ -163,11 +163,17 @@ namespace OpenSim.Client.Linden | |||
163 | 163 | ||
164 | if (m_serversInfo.HttpUsesSSL) | 164 | if (m_serversInfo.HttpUsesSSL) |
165 | { | 165 | { |
166 | seedcap = "https://" + m_serversInfo.HttpSSLCN + ":" + m_serversInfo.httpSSLPort + capsSeedPath; | 166 | // For NAT |
167 | string host = NetworkUtil.GetHostFor(remoteClient.Address, m_serversInfo.HttpSSLCN); | ||
168 | |||
169 | seedcap = "https://" + host + ":" + m_serversInfo.httpSSLPort + capsSeedPath; | ||
167 | } | 170 | } |
168 | else | 171 | else |
169 | { | 172 | { |
170 | seedcap = "http://" + regionInfo.ExternalHostName + ":" + m_serversInfo.HttpListenerPort + capsSeedPath; | 173 | // For NAT |
174 | string host = NetworkUtil.GetHostFor(remoteClient.Address, regionInfo.ExternalHostName); | ||
175 | |||
176 | seedcap = "http://" + host + ":" + m_serversInfo.HttpListenerPort + capsSeedPath; | ||
171 | } | 177 | } |
172 | 178 | ||
173 | response.SeedCapability = seedcap; | 179 | response.SeedCapability = seedcap; |
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 | |||
279 | 279 | ||
280 | if (m_serversInfo.HttpUsesSSL) | 280 | if (m_serversInfo.HttpUsesSSL) |
281 | { | 281 | { |
282 | seedcap = "https://" + m_serversInfo.HttpSSLCN + ":" + regionInfo.HttpPort + capsSeedPath; | 282 | // For NAT |
283 | string host = NetworkUtil.GetHostFor(remoteClient.Address, m_serversInfo.HttpSSLCN); | ||
284 | |||
285 | seedcap = "https://" + host + ":" + m_serversInfo.httpSSLPort + capsSeedPath; | ||
283 | } | 286 | } |
284 | else | 287 | else |
285 | { | 288 | { |
286 | seedcap = "http://" + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort + capsSeedPath; | 289 | // For NAT |
290 | string host = NetworkUtil.GetHostFor(remoteClient.Address, regionInfo.ExternalHostName); | ||
291 | |||
292 | seedcap = "http://" + host + ":" + m_serversInfo.HttpListenerPort + capsSeedPath; | ||
287 | } | 293 | } |
288 | 294 | ||
289 | response.SeedCapability = seedcap; | 295 | response.SeedCapability = seedcap; |
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 | |||
270 | 270 | ||
271 | string capsPath = CapsUtil.GetRandomCapsObjectPath(); | 271 | string capsPath = CapsUtil.GetRandomCapsObjectPath(); |
272 | 272 | ||
273 | // Take off trailing / so that the caps path isn't //CAPS/someUUID | 273 | // For NAT |
274 | if (regionInfo.httpServerURI.EndsWith("/")) | 274 | string host = NetworkUtil.GetHostFor(remoteClient.Address, regionInfo.ServerIP); |
275 | regionInfo.httpServerURI = regionInfo.httpServerURI.Substring(0, regionInfo.httpServerURI.Length - 1); | 275 | // TODO: This doesnt support SSL. -Adam |
276 | response.SeedCapability = regionInfo.httpServerURI + CapsUtil.GetCapsSeedPath(capsPath); | 276 | string serverURI = "http://" + host + ":" + regionInfo.ServerPort; |
277 | |||
278 | response.SeedCapability = serverURI + CapsUtil.GetCapsSeedPath(capsPath); | ||
277 | 279 | ||
278 | // Notify the target of an incoming user | 280 | // Notify the target of an incoming user |
279 | m_log.InfoFormat( | 281 | m_log.InfoFormat( |
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 85a3d96..b89a5f2 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | |||
@@ -812,17 +812,32 @@ namespace OpenSim.Region.Framework.Scenes | |||
812 | 812 | ||
813 | if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY)) | 813 | if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY)) |
814 | { | 814 | { |
815 | capsPath | 815 | #region IP Translation for NAT |
816 | = "http://" | 816 | IClientIPEndpoint ipepClient; |
817 | + reg.ExternalHostName | 817 | if (avatar.ClientView.TryGet(out ipepClient)) |
818 | + ":" | 818 | { |
819 | + reg.HttpPort | 819 | capsPath |
820 | + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); | 820 | = "http://" |
821 | + NetworkUtil.GetHostFor(ipepClient.EndPoint, reg.ExternalHostName) | ||
822 | + ":" | ||
823 | + reg.HttpPort | ||
824 | + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); | ||
825 | } | ||
826 | else | ||
827 | { | ||
828 | capsPath | ||
829 | = "http://" | ||
830 | + reg.ExternalHostName | ||
831 | + ":" | ||
832 | + reg.HttpPort | ||
833 | + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); | ||
834 | } | ||
835 | #endregion | ||
821 | 836 | ||
822 | if (eq != null) | 837 | if (eq != null) |
823 | { | 838 | { |
824 | #region IP Translation for NAT | 839 | #region IP Translation for NAT |
825 | IClientIPEndpoint ipepClient; | 840 | // Uses ipepClient above |
826 | if (avatar.ClientView.TryGet(out ipepClient)) | 841 | if (avatar.ClientView.TryGet(out ipepClient)) |
827 | { | 842 | { |
828 | endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address); | 843 | endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address); |