* 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)0.6.6-post-fixes
parent
e9ea959263
commit
6b312d9340
|
@ -163,11 +163,17 @@ namespace OpenSim.Client.Linden
|
||||||
|
|
||||||
if (m_serversInfo.HttpUsesSSL)
|
if (m_serversInfo.HttpUsesSSL)
|
||||||
{
|
{
|
||||||
seedcap = "https://" + m_serversInfo.HttpSSLCN + ":" + m_serversInfo.httpSSLPort + capsSeedPath;
|
// For NAT
|
||||||
|
string host = NetworkUtil.GetHostFor(remoteClient.Address, m_serversInfo.HttpSSLCN);
|
||||||
|
|
||||||
|
seedcap = "https://" + host + ":" + m_serversInfo.httpSSLPort + capsSeedPath;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
seedcap = "http://" + regionInfo.ExternalHostName + ":" + m_serversInfo.HttpListenerPort + capsSeedPath;
|
// For NAT
|
||||||
|
string host = NetworkUtil.GetHostFor(remoteClient.Address, regionInfo.ExternalHostName);
|
||||||
|
|
||||||
|
seedcap = "http://" + host + ":" + m_serversInfo.HttpListenerPort + capsSeedPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
response.SeedCapability = seedcap;
|
response.SeedCapability = seedcap;
|
||||||
|
|
|
@ -279,11 +279,17 @@ namespace OpenSim.Framework.Communications.Services
|
||||||
|
|
||||||
if (m_serversInfo.HttpUsesSSL)
|
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
|
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;
|
response.SeedCapability = seedcap;
|
||||||
|
|
|
@ -270,10 +270,12 @@ namespace OpenSim.Grid.UserServer.Modules
|
||||||
|
|
||||||
string capsPath = CapsUtil.GetRandomCapsObjectPath();
|
string capsPath = CapsUtil.GetRandomCapsObjectPath();
|
||||||
|
|
||||||
// Take off trailing / so that the caps path isn't //CAPS/someUUID
|
// For NAT
|
||||||
if (regionInfo.httpServerURI.EndsWith("/"))
|
string host = NetworkUtil.GetHostFor(remoteClient.Address, regionInfo.ServerIP);
|
||||||
regionInfo.httpServerURI = regionInfo.httpServerURI.Substring(0, regionInfo.httpServerURI.Length - 1);
|
// TODO: This doesnt support SSL. -Adam
|
||||||
response.SeedCapability = regionInfo.httpServerURI + CapsUtil.GetCapsSeedPath(capsPath);
|
string serverURI = "http://" + host + ":" + regionInfo.ServerPort;
|
||||||
|
|
||||||
|
response.SeedCapability = serverURI + CapsUtil.GetCapsSeedPath(capsPath);
|
||||||
|
|
||||||
// Notify the target of an incoming user
|
// Notify the target of an incoming user
|
||||||
m_log.InfoFormat(
|
m_log.InfoFormat(
|
||||||
|
|
|
@ -811,6 +811,19 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
avatar.CloseChildAgents(newRegionX, newRegionY);
|
avatar.CloseChildAgents(newRegionX, newRegionY);
|
||||||
|
|
||||||
if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY))
|
if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY))
|
||||||
|
{
|
||||||
|
#region IP Translation for NAT
|
||||||
|
IClientIPEndpoint ipepClient;
|
||||||
|
if (avatar.ClientView.TryGet(out ipepClient))
|
||||||
|
{
|
||||||
|
capsPath
|
||||||
|
= "http://"
|
||||||
|
+ NetworkUtil.GetHostFor(ipepClient.EndPoint, reg.ExternalHostName)
|
||||||
|
+ ":"
|
||||||
|
+ reg.HttpPort
|
||||||
|
+ CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
capsPath
|
capsPath
|
||||||
= "http://"
|
= "http://"
|
||||||
|
@ -818,11 +831,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
+ ":"
|
+ ":"
|
||||||
+ reg.HttpPort
|
+ reg.HttpPort
|
||||||
+ CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
|
+ CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
if (eq != null)
|
if (eq != null)
|
||||||
{
|
{
|
||||||
#region IP Translation for NAT
|
#region IP Translation for NAT
|
||||||
IClientIPEndpoint ipepClient;
|
// Uses ipepClient above
|
||||||
if (avatar.ClientView.TryGet(out ipepClient))
|
if (avatar.ClientView.TryGet(out ipepClient))
|
||||||
{
|
{
|
||||||
endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address);
|
endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address);
|
||||||
|
|
Loading…
Reference in New Issue