Can Security.PrefetchSocketPolicy use host name instead of IP ?

After some fight against crossdomain.xml, I finally add a new port to my server, and used as a security service that respond the expected content of the crossdomain.xml file.

this post was a good inspiration :slight_smile: http://forum.unity3d.com/threads/60922-Solved-Crossdomain-Problem?highlight=crossdomain+socket

but the issue that I’m facing is that Security.PrefetchSocketPolicy() only accepts the server IP,
can we use a host name instead ? thats why Dns exists =)

any walkaround for this ?

Im pretty sure it supports a hostname, but if it doesnt u can do this

using System.Net;

static string getIP(string hostname)
{
return Dns.GetHostAddresses(hostname)[0].ToString();
}

will try later with this, thx.

made a little change in ur code to use on javascript

import System.Net;

static function getIP(hostname: String ):String{
	var ip = Dns.GetHostAddresses(hostname)[0].ToString();
	Debug.Log(hostname + "=" + ip);
	return ip;
}

and worked fine, but the Security.PrefetchSocketPolicy() really only accepted IP not hostnames … thx for ur help !