when change localhost:5055 to my ext ip get exception[reslv]

mrde
edited September 2011 in Photon Server
Hi
I Use Unity 3.4 and Photon 3 rc3.

my code ....
............................................................ begin code

public class BBClientHandler : MonoBehaviour, IPhotonPeerListener {

protected BBClientPeer Peer;
public string ServerAddress = "localhost:5055";
protected string ServerApplication = "AppName";

// Use this for initialization
public virtual void Start()
{
this.Peer = new BBClientPeer(this);
this.Connect();
}

public virtual void Connect()
{
this.Peer.Connect(this.ServerAddress, this.ServerApplication);
}
............................................................ end code

When I use Ip localhost:5055 or 127.0.0.1:5055 it runs fine.
But whene I change localhost to my external(global) Ip unity throw exception...

Connect() failed: System.Security.SecurityException: Unable to connect, as no valid crossdomain policy was found
at System.Net.Sockets.Socket.Connect_internal (IntPtr sock, System.Net.SocketAddress sa, System.Int32& error, Boolean requireSocketPolicyFile) [0x00000] in <filename unknown>:0
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in <filename unknown>:0
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0
at System.Net.Sockets.Socket.Connect (System.Net.IPAddress address, Int32 port) [0x00000] in <filename unknown>:0
at ExitGames.Client.Photon.NConnect.StartConnection () [0x00000] in <filename unknown>:0
UnityEngine.MonoBehaviour:print(Object)
BBClientHandler:DebugReturn(DebugLevel, String) (at Assets/Scripts/Photon/BBClientHandler.cs:68)
ExitGames.Client.Photon.NConnect:StartConnection()
ExitGames.Client.Photon.EnetPeer:Connect(String, String, Byte)
ExitGames.Client.Photon.PhotonPeer:Connect(String, String)
BBClientHandler:Connect() (at Assets/Scripts/Photon/BBClientHandler.cs:45)
BBClientHandler:Start() (at Assets/Scripts/Photon/BBClientHandler.cs:39)

Comments

  • you need to change the ip for the policy application on the server to your external ip as well.
  • I am new in Photon and don't know how do changes, please write detailed.
    Thanks
  • there is a settings.xml file in your photon deploy folder, open it with your favorite text editor and look if you have some localhost/127.0.0.1 configured in there, if so change that to your external Ip adress as well.
  • The documentation otherwise contains information on the matter too
  • I don't understand why i can not find settings.xml file. I look in documentation http://developer.exitgames.com there is no material about this file. Please send me example file or link about this.
    Thank you very much.
  • Hey,

    seems the file has been renamed or I just have brainlag, anyway checkout this part of the docs:

    http://developer.exitgames.com/v3/photo ... pandconfig

    hope it helps.

    cheers
  • Thanks you all.
    I understand my problem. I connect to internet with modem, whitch connect to internet not I. I connect to modem. I NAT from modem 843, 5055 ports to my pc ip and it runs fine. :D