- Home /
Question by
TeamON · May 04, 2021 at 08:50 AM ·
multiplayerclient-serverip
Unity MLAPI. How get client IP on server side?
I study Unity MLAPI. How to find the IP address of the connected client on the server?
Comment
Answer by TeamON · May 05, 2021 at 10:23 AM
I found a temporary solution. Use a third-party site to get a string variable with ip address, which can then be passed to the server.
using System.Net;
private void Start()
{
string externalIP = new WebClient().DownloadString("http://icanhazip.com");
Debug.Log(externalIP);
}
For greater reliability, you can use multiple sites if one of them is not available. Here is some of them:
Your answer
Follow this Question
Related Questions
UNET Client Cant Send Server Commands, Host Can. 1 Answer
Confusing in Multiplayer Networking uNet Client-Server 0 Answers
Can MLAPI connect to a standalone server written in another language (Go) 0 Answers
Order of Execution in Multiplayer 2 Answers
Rpc Can't be called on client - Problem with client, works on server 1 Answer