Search Unity

Get the ip address of the server i'm connected to.

Discussion in 'Multiplayer' started by Flapstik, May 10, 2017.

  1. Flapstik

    Flapstik

    Joined:
    May 10, 2017
    Posts:
    1
    Where can I find the ip address of the server i'm connected to from the client with just the standard unity networking?

    Thanks.
     
  2. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    574
    GetConnectionInfo(...) i think, but it will be ip address which client seeing. If client and server belongs the same local network it will be internal address
     
  3. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    1,168
    Easiest way IMO. Get your own NetworkIdentity. (GetComponent<NetworkIdentity>()). In the networkidentity access connectionToServer and there you will have all info you need