Search Unity

403 forbidden from UnityEditor but not from WebGL build

Discussion in 'Multiplayer' started by pinksheep8426, May 14, 2020.

  1. pinksheep8426

    pinksheep8426

    Joined:
    Jul 2, 2016
    Posts:
    5
    Hi,

    I'm trying to make a basic multiplayer system in WebRequest (I know there's better ways but for what I need WebRequest will get the job done).

    When running in the Unity Editor or as a Windows executable, the web page returns a 403 forbidden error page. When running in WebGL, I get the json I need returned from the webpage. This does not change when using the old WWW system.

    Additionally, when I use the .Net WebRequest system, the webpage returns the correct json however I would not be able to use this because the final product will need to be in WebGL.

    I think that the problem lies in the server configuration however I have no idea what it could be.

    Any help is appreciated, thanks in advance :)
     
  2. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    The simplest way to find out is to setup HTTP debugging proxy, such as Fiddler, and compare the HTTP messages of request that does work and the one that doesn't.
    Does your website use some kind of authorization, for example via cookies? That is often the reason.
    Can you show the code for your request?
     
  3. pinksheep8426

    pinksheep8426

    Joined:
    Jul 2, 2016
    Posts:
    5
    Its all good, contacted the server company and it turned out that they hadn't whitelisted something but it works now