Hello,
We have an Web Application created by Unity. We’re trying to access a remote server using WWW class provided. When I try the WebGL build on my local machine, it can communicate with remote server. However when I put the WebGL build on the remote server (which will represent our Web Application, simply where the index.html is ) the communication gives error.
Here’s the code:
IEnumerator ss() {
WWWForm form = new WWWForm ();
form.AddField ("name", "hello");
url = "remote.server.ip.address:port";
WWW www = new WWW(url,form);
yield return www;
if (www.error != null) {
Debug.Log ("Error is not null" + www.error);
theText.text = "Err:" +www.error;
} else {
string formText = www.text;
Debug.Log ("Response: " + formText);
theText.text = formText;
}
}
And error www.error returns an UNKNOWN ERROR.
What may be the cause? I’ve seen some topics that says it may be related to CORS. But I am not sure about the real reason behind this problem. Could you please help?
Thank you.