Search Unity

  1. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  2. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Participate with students all over the world and build projects to teach people. Join now!
    Dismiss Notice
  5. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Unity Multiplayer LLAPI - How can the server get the IP address of a connected webgl (websocket) connection?

Discussion in 'Connected Games' started by Seth-Robinson, Dec 29, 2017.

  1. Seth-Robinson


    Aug 24, 2013
    I've done a lot of LLAPI testing recently (see my blog post about it, includes my test project) but it seems to me it's not currently possible for the server to query the LLAPI for the IP address of a connected webgl/websocket user.

    Code (csharp):
    2. case NetworkEventType.ConnectEvent:
    3. ...
    4.  NetworkTransport.GetConnectionInfo(tempHostID, outConnectionId, out client.ip, out clientPort, out clientNetID, out clientNodeID, out error);
    5.                             if ((NetworkError)error != NetworkError.Ok)
    6.                             {
    7.                                 Log("NetworkTransport.GetConnectionInfo " + tempHostID + " - Error: " +  (NetworkError)error);
    8.                             }
    This code works perfectly on a non-webgl connection but on a webgl user will return: "Error: WrongOperation". Everything else works fine, the webgl user can connect and play the game with non-webgl users without problems.

    Am I doing something wrong or Unity just doesn't give this info yet?
    Last edited: Mar 27, 2018