Problem with HttpRequests from my game to Azure in certain countries

I’m having a very frustrating problem with my WebGL game.

I have built an Azure Function that my game client calls, the Azure function gets the token from a 3rd party, and passes it back to the game client.

The problem is, any request from RU, AM, KZ, as well as requests from JP and UA seem to have a problem making the request from my game client to the Azure Function. There is no error or exception in the Azure Function, and I have asked the 3rd party to check their side and they don’t see any failed requests.

So the problem definitely lies in Unity making the HTTP request.

I initially tried using UnityWebRequest, then I also tried SimpleHttp from GitHub.
The error I get back from UnityWebRequest/SimpleHttp is just an unknown error.

Error message : Unknown Error.
Error status code : 0
Error body:

Which is not helpful at all. I am using Unity 2020.3.12.

I even tried forcing all the strings in the request params/url to a CultureInfo of en-US, thinking a strange character might be inserted in the request or something, but this doesn’t make a difference.

Any ideas what could cause this?

Hi!

This is a weird one! In Unity 2020, UnityWebRequest is simply an XHR request.

Here’s a few suggestions that could help diagnose what’s going on with the web request:

  1. Have you tried using HTTPS, rather than HTTP? HTTP traffic may be inspected and modified by firewalls.
  2. If the Azure function is accessed through a different domain, did you check that the CORS/COEP headers are setup correctly?
  3. Are there different browsers used in these countries, or do they have different default settings?
  1. It is only using HTTPS
  2. Why would the CORS headers work for everyone else then? How would I setup CORS headers to allow Russian countries in?
  3. There is no pattern from what I can see as to the browser being used. They are using standard popular browsers such as Chrome/Edge/Firefox etc.

So, there shouldn’t be anything different between Unity’s web requests and a regular Javascript request. So can you place a Javascript XHR or Fetch request to your Azure function in your page (either the Unity template, or your own JS code that you load in the HTML page), with some mechanism to capture the error and send it back to you, and post what that returns?

Unfortunately I’m not in a position to reproduce this error myself, its being logged in Raygun by players from these regions, and I don’t have any contact info with.

I’m guessing the best would be for me to use a VPN and change my browser language to RU and see if I can reproduce.

But thanks, this seems like the only possible way to investigate further.