Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

[Request] Proxy settings for Unity Hub

Discussion in 'Unity Hub' started by crocvr, Feb 2, 2018.

  1. crocvr

    crocvr

    Joined:
    Oct 7, 2015
    Posts:
    44
    Hello!

    Do you plan to add proxy settings for Unity Hub?

    It will be good to set settings for proxy in one place.
    It is always the problem for company with proxy to create rules for all services and licenses.
     
    saqib1707, micsanbr and ThuLePham like this.
  2. afshinity

    afshinity

    Unity Technologies

    Joined:
    Jul 31, 2017
    Posts:
    334
    Hi there,
    Thank you for using Unity Hub.
    This feature is not in our immediate plan. I will add it to our feature requests. Thanks for the feedback.
     
    crocvr likes this.
  3. crocvr

    crocvr

    Joined:
    Oct 7, 2015
    Posts:
    44
    Last edited: Mar 30, 2018
  4. angularsen

    angularsen

    Joined:
    Apr 22, 2017
    Posts:
    18
    I'm trying this with Unity Hub (and also tried running Unity.exe manually for the version installed by Hub), but not getting it to work with Fiddler to view the requests and responses.

    HTTP_PROXY=http://localhost:8888
    HTTPS_PROXY=http://localhost:8888
    NO_PROXY=localhost,127.0.0.1
    UNITYNO_PROXY=localhost,127.0.0.1

    Also tried in <system.net> to add this...

    <defaultProxy>
    <proxy proxyaddress="http://localhost:8888"/>
    </defaultProxy>

    ...to machine.config files for the Unity Editor version I am running:
    C:\Program Files\Unity\Hub\Editor\2018.1.6f1\Editor\Data\Mono\etc\mono\2.0\machine.config
    C:\Program Files\Unity\Hub\Editor\2018.1.6f1\Editor\Data\Mono\etc\mono\1.0\machine.config

    And for the non-hub installed one:
    C:\Program Files\Unity\Editor\Data\Mono\etc\mono\2.0\machine.config

    I am now getting some Hub application requests in Fiddler, which I didn't get before, but still nothing from the game scripts using HttpClient. I even tried Wireshark and from what I can tell nothing shows up there either, but not too familiar with that one. The requests do go through though, I know that much.

    Any ideas?

    I have not yet tried a non-Hub installed version, I guess that's the only thing left to try.
     
    dzmitry-lahoda likes this.
  5. angularsen

    angularsen

    Joined:
    Apr 22, 2017
    Posts:
    18
    Tried with non-hub installed Unity and still not getting anything in Fiddler. When I explicitly set the proxy on a HttpClient, though, I got the request in Fiddler. So I am still looking for a way to configure all http requests in all my game scripts running in Unity, without having to explicitly configure it in code.
     
    dzmitry-lahoda likes this.
  6. afshinity

    afshinity

    Unity Technologies

    Joined:
    Jul 31, 2017
    Posts:
    334
    Hi there,
    Sorry for the inconvenience.
    If the issue is not specific to the hub, I suggest sharing it on the editor forum or send an email to the Unity support.
    If it is only happening when you install an editor through the hub, you can send me your log files with a direct message.

    Best,
    Afshin
     
  7. angularsen

    angularsen

    Joined:
    Apr 22, 2017
    Posts:
    18
    Right, I just confirmed I cannot get proxy working with non-hub installed Editor so this is not related to Hub.
     
    afshinity likes this.
  8. bl-mm

    bl-mm

    Joined:
    Nov 23, 2018
    Posts:
    4
    Any news for this? My company uses a proxy, can't download any version with the Unity Hub ...
     
  9. WavyRancheros

    WavyRancheros

    Joined:
    Feb 5, 2013
    Posts:
    163
    Limiting the release of Unity 2019.1 to the Unity Hub is pretty bad. I'm behind a company proxy.
     
  10. micsanbr

    micsanbr

    Joined:
    Apr 8, 2014
    Posts:
    20
    I am also behind a company proxy which requires authentication.
    Unity 2018.3.10 is able to connect through the proxy (using the environment variable UNITY_PROXYSERVER).
    The hub does not use the same environment variable and I cannot install 2019.1 using the Hub ...
    In other words, this is hub-specific
    @afshinity: Is it really so hard to fix this? What does it mean this is not planned for now?
    Auth Proxy support is the #1 most important feature that corporate users require ... how come this isn't your top priority?
     
  11. micsanbr

    micsanbr

    Joined:
    Apr 8, 2014
    Posts:
    20
    I managed to install the Unity Editor 2019.1 manually and now I have to install each module (android, ios, uwp) manually and separately.
    If you don't care about fixing this, at least please bring back the download / installation assistant.
     
    saqib1707 likes this.
  12. micsanbr

    micsanbr

    Joined:
    Apr 8, 2014
    Posts:
    20
    Another thing: the installation of the "Android Build Support and the Android SDK & NDK tools" via the the hub does not work as well.
    I've tried using the latest, updated Android SDK components that got installed with Android Studio and they are not working.
    On top of that, the "internal build" has been finally deprecated and guess what? Gradle does not cope well with our proxy as well ...
    What a mess.
     
    saqib1707 and ThuLePham like this.
  13. WavyRancheros

    WavyRancheros

    Joined:
    Feb 5, 2013
    Posts:
    163
    It's surprising and irritating. I thought game dev studios that use Unity also use proxies. Adding proxy support to the Hub before cancelling the online installers for 2019 should have been a priority.
     
    saqib1707 and micsanbr like this.
  14. ShwethaKrishnaa

    ShwethaKrishnaa

    Joined:
    May 27, 2019
    Posts:
    7
    Hello, I am not able to Login into Unity Hub because I am working behind a corporate Proxy.
    I am very new to unity and its setup so where do I have to set this variable? Is there any config file where I can add these?
     
    saqib1707 likes this.
  15. safaGH

    safaGH

    Unity Technologies

    Joined:
    Mar 12, 2019
    Posts:
    224
    saqib1707 likes this.
  16. ShwethaKrishnaa

    ShwethaKrishnaa

    Joined:
    May 27, 2019
    Posts:
    7
    Sure will try doing it
     
  17. micsanbr

    micsanbr

    Joined:
    Apr 8, 2014
    Posts:
    20
    What for? I have set those on my system anyway, but I don't think the package manager uses those.

    The only thing that works with our proxy (with authentication) is setting UNITY_PROXYSERVER in the environment variables.
    Its value is set to something like http://username: password@example.com:8080
    That helps with the license and the assetstore here.
    The Unity Hub and the Package Manager still don't work, unless I connect to a non-intranet router
     
  18. ShwethaKrishnaa

    ShwethaKrishnaa

    Joined:
    May 27, 2019
    Posts:
    7
    safaGH likes this.
  19. Mazzeman

    Mazzeman

    Joined:
    Mar 3, 2017
    Posts:
    7

    I indeed concur that this is a cluster f* . Found a solution to this prob if people indeed want to use the SDK and NDK installed by the Unity Hub.

    After installation with Android Build checked, it times out and installs, just be patient. Then open Android Studio to set up the platforms. Android Studio has support for proxy settings and pushes it into the sdkmanager automatically.
    Its possible to install it the manual way by running the bat file as well, then you have to input proxy setting flags manually.

    Either way you do want to do this if you want to build Android apps through Unity.
    Navigate to your sdk directory, e.g. "F:\Unitys\2019.1.14f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\bin"

    >> sdkmanager.bat --no_https --proxy=http --proxy_host=<DNS or IP> --proxy_port=<PORT>

    As sdkmanager has support for proxy, the solution is to edit the bat file. YES I know, its unbelievable that we have to go through these steps.

    Edit the following lines:
    Proxy1.PNG


    Proxy2.PNG
    Note the whitespaces. Thus your sdkmanager.bat has proxy variables inside the actual bat-file. Would recommend to do a backup of the sdkmanager.bat before.
     
    Xandir88 likes this.
  20. micsanbr

    micsanbr

    Joined:
    Apr 8, 2014
    Posts:
    20
    Anyone found a solution for gradle behind proxy yet?
     
  21. savely00

    savely00

    Joined:
    Feb 27, 2014
    Posts:
    36
    I am working on Windows 10 machine behind corporate proxy and I am using a Hub launch script as suggested.
    With my current proxy settings I can start the Hub but I cannot start the project because Package manages hangs up.
    If I disable "Use a proxy server" in Control Panel Proxy settings the project is loading.
    This means that Unity Hub proxy settings applied on top of system proxy settings instead of replacing them.
    Every time I need to change Package manager settings I have to disable system proxy settings.
    This work around is working for me but I'd like to have a permanent solution from Unity.
    Note: I can open Unity 2019.2.2f1 project without all that proxy switching, but not projects after that version.
    Note 2: Setting user name and password in the Hub launch script with proxy do not make any difference in my case.
     
    McRain-Developer likes this.
  22. aseriesofdarkcaves

    aseriesofdarkcaves

    Joined:
    Feb 16, 2020
    Posts:
    1
    Another +1 for implementing proxy setting configuration via UI. Licence activation is like jumping through hoops and a terrible first experience for a new user.
     
    rsngc likes this.
  23. wiethuechterandrea

    wiethuechterandrea

    Joined:
    Oct 1, 2020
    Posts:
    3
    This worked for me, thank you
     
  24. Midiphony-panda

    Midiphony-panda

    Joined:
    Feb 10, 2020
    Posts:
    212
    [Android] [Enterprise proxy]
    For the life of me I couldn't understand why the Unity Android SDK Manager always spent more than 5 minutes to find the SDK platform tools. I finally took a look at the Editor.log and saw that the Unity Android SDK tools logged many, many, many times the followings :
    • Failed to download any source lists!
    • java.net.ConnectException: Connection timed out: connect
    I eventually thought about proxy issues and stumbled upon this thread.
    @Mazzeman solution still holds up.

    It seems that the Unity Android SDK Manager doesn't take your proxy settings into account.
    Even if you have saved them as env variables :
    HTTP_proxy and HTTPS_proxy

    For convenience and posteriority, I'll paste here the three lines provided by Mazzemann, that anyone would need to add manually in the Unity sdkmanager.bat file.
    The file is here : C:\Program Files\Unity\Hub\Editor\[YourUnityVersion]\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\bin\sdkmanager.bat

    1. Set this variable
      set PROXY_VARIABLES= --no_https --proxy=http --proxy_host=YOURPROXYADDRESS --proxy_port=YOURPROXYPORT
    2. Modify this line
      set DEFAULT_JVM_OPTS="-Dcom.android.sdklib.toolsdir=%~dp0\.." -Dhttp.proxyHost=YOURPROXYADDRESS -Dhttp.proxyPort=YOURPROXYPORT
    3. Modify this line
      "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %SDKMANAGER_OPTS%  -classpath "%CLASSPATH%" com.android.sdklib.tool.sdkmanager.SdkManagerCli %CMD_LINE_ARGS% %PROXY_VARIABLES%
     
    dadahsueh likes this.
  25. saqib1707

    saqib1707

    Joined:
    Apr 21, 2021
    Posts:
    2
    Where do we need to add these proxy settings for Unity 2020.3 installed on Windows ?
     
  26. saqib1707

    saqib1707

    Joined:
    Apr 21, 2021
    Posts:
    2
    I am facing this issue. Has anyone solved this or know where can we add the proxy settings ?
     
  27. mk_dev

    mk_dev

    Joined:
    Mar 7, 2017
    Posts:
    2
    Unity really should recognise that this situation is a total mess. 27 comments on this thread alone. Most other enterprise ready app (this is enterprise ready, right?) have the ability to easily setup proxy information that is reliable between functions and versions. This clearly is NOT that kind of app and is a total nightmare to figure out. At the very minimum, documentation is poor. I have had to play Unity detective several times to figure out exactly what should not be SSL inspected on the proxy. Having reliable proxy setting might have helped here. @Unity, take this seriously please!
     
  28. BenjiM_Unity

    BenjiM_Unity

    Unity Technologies

    Joined:
    Aug 8, 2017
    Posts:
    138
unityunity