0

I'm using "Network Lobby" asset for unity and trying to make webGL build with using WebSockets. When I create a game or get a list of servers I get the following error:

XMLHttpRequest cannot load https://mm.unet.unity3d.com/json/reply/ListMatchRequest. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'my_domain_name' is therefore not allowed access.

Is it a problem on the server or on the client? And how can I solve it?

Community
  • 1
  • 1
Aleksandr
  • 1
  • 1
  • 2
  • Problem is with server. Do you control this too? – Chris Mar 25 '17 at 17:48
  • To be honest, I'm not sure I can. This is a standard multiplayer from a unity online services. I can control this only in my account https://developer.cloud.unity3d.com/projects/ – Aleksandr Mar 25 '17 at 17:57

1 Answers1

1

The problem is with the server. The server has to give permission (by sending the correct headers) before the browser will let you read the data.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS

gman
  • 100,619
  • 31
  • 269
  • 393