mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 03:45:35 +08:00
* 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)
This commit is contained in:
@@ -812,17 +812,32 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY))
|
||||
{
|
||||
capsPath
|
||||
= "http://"
|
||||
+ reg.ExternalHostName
|
||||
+ ":"
|
||||
+ reg.HttpPort
|
||||
+ CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
|
||||
#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
|
||||
= "http://"
|
||||
+ reg.ExternalHostName
|
||||
+ ":"
|
||||
+ reg.HttpPort
|
||||
+ CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
|
||||
}
|
||||
#endregion
|
||||
|
||||
if (eq != null)
|
||||
{
|
||||
#region IP Translation for NAT
|
||||
IClientIPEndpoint ipepClient;
|
||||
// Uses ipepClient above
|
||||
if (avatar.ClientView.TryGet(out ipepClient))
|
||||
{
|
||||
endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address);
|
||||
|
||||
Reference in New Issue
Block a user