Search Unity

Master Server with Proxy Server

Discussion in 'Multiplayer' started by ZOKA, Nov 27, 2014.

  1. ZOKA

    ZOKA

    Joined:
    Jul 23, 2013
    Posts:
    1
    I'm trying to connect with my own master server when the port on route was blocked.

    First, i set up a normal connection with master server

    Code (CSharp):
    1. MasterServer.ipAddress = "xx.xx.xx.xx";
    2. MasterServer.port = 23466;
    3. Network.natFacilitatorIP = "xx.xx.xx.xx";
    4. Network.natFacilitatorPort = 50005;
    Then i request host list:
    Code (CSharp):
    1. MasterServer.RequestHostList ("TestConnection");
    If route block my port, i detect it on: void OnFailedToConnectToMasterServer (NetworkConnectionError info)
    Then change to useProxy server on this function

    Code (CSharp):
    1. void OnFailedToConnectToMasterServer (NetworkConnectionError info)
    2.  {
    3. //-- Something here
    4.  
    5. Network.proxyIP = "xx.xx.xx.xx";
    6. Network.proxyPort = myPort;
    7. Network.useProxy = true;
    8.  
    9. MasterServer.RequestHostList ("TestConnection");
    10. }
    11.  
    But nothing happen at the second request host list.

    Can anyone help me solve this problem :(

    P/s: I'm not good at English, so sorry for my mistakes in this post !