Search Unity

Best HTTP Released

Discussion in 'Assets and Asset Store' started by BestHTTP, Sep 11, 2013.

  1. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @tessm Thanks for the report, I will look for it!
     
  2. light530

    light530

    Joined:
    Aug 30, 2016
    Posts:
    12
    Hello

    I sent the test url to your email
     
  3. tedlofgren

    tedlofgren

    Joined:
    Apr 16, 2015
    Posts:
    4
    No problem :)

    Oh, when I still remember. I would like to make a contribution. Feel free to use it, or not.

    I modified HTTPRequest:SendOutTo to use a BufferedStream to make sure that the TLS layer gets nice big chunks of data. Got far too many records before.

    Code (CSharp):
    1.  
    2. internal void SendOutTo(Stream stream)
    3.         {
    4.             try
    5.             {
    6.                 BufferedStream bufStream = new BufferedStream(stream, 4096);
    7.                 BinaryWriter outStream = new BinaryWriter(bufStream);
    8. ...
    9.  
    10.  
    Thanks again.
     
  4. light530

    light530

    Joined:
    Aug 30, 2016
    Posts:
    12
    Ok... may be the problem is fixed... since I just make a correct setting of maxAge of the file in server.

    thank you for your help!
     
  5. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @light530

    The zero max-age is a problem too, but I'm also found a bug where restarting the game may deleted a cache entry.
    I will send an updated package to you in a private message/email.
     
  6. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @tessm

    Thanks, I will check this out too, it looks like a good improvement.
     
  7. light530

    light530

    Joined:
    Aug 30, 2016
    Posts:
    12
    Thank you very much. Wait for your package.
     
  8. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @light530 Sent it as a reply to your mail.
     
  9. mcominetti

    mcominetti

    Joined:
    Aug 18, 2016
    Posts:
    1
    @BestHTTP
    Hello, I've been using your library for a while in Unity to communicate with an external SignalR server. It has worked great, but as I tried to connect several clients (from within unity) to the server it stopped behaving as expected: some clients don't connect and just stay in a "connecting" state and others just time out soon after connecting.
    It seems stable with 1-3 clients, but as I connect more it's not. I cannot replicate this when connecting native SignalR clients to the server so it seems to be a limitation of the library.
    Can you please advise?
     
  10. byron_pap

    byron_pap

    Joined:
    Apr 16, 2015
    Posts:
    6
    Hello @BestHTTP , has anything changed in the latest version of this package that would affect WebGL in 5.4?
    I've been using your Best HTTP with another package WAK(Web API Kit) and after recently updating my HTTP Requests are returning empty in WebGL builds. The requests are still working fine in every other platform and in the Editor.

    I've spent the last couple of days trying to debug both packages and have only managed to get it working in WebGL builds by switching my calls to use UnityWebRequest.

    Any clues would be much appreciated.

    Cheers, Byron
     
  11. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @mcominetti
    Here I tried to run 7 clients. As you can see the first client reported others, they were able to connect successfully.
    As my Azure website has a maximum websocket connection, the last two failed to connect with this transport, but successfully downgraded back to the polling transport.
    upload_2016-9-2_8-47-52.png


    Can you send any logs, or something from the clients that can't connect?
     
  12. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @byron_pap
    There were changes that might cause it. There is also a known an fixed bug. I will send an updated package to you in private.
     
  13. andermon

    andermon

    Joined:
    Aug 29, 2016
    Posts:
    14
    Awesome Plugin so far its working great, I am stuck on getting through a proxy though.

    I have a proxy that I need to connect to as all requests need to go through it.
    Currently I set the proxy on the request using the .Proxy(Uri());, and I am hitting the proxy as I get a responce "No Connection could be made because the target machine actively refused it", is there a way to test if the refusal is from the local machine, or from the proxy. It is peculiar as I have hit the proxy using all the same information in Unity but using the HTTPWebRequest.

    Thanks for the help
     
  14. light530

    light530

    Joined:
    Aug 30, 2016
    Posts:
    12
    It seems the package works even the max-age is zero. The cache file is not deleted when restart game.
    The asset is updated successfully when I modify the resource in server.

    It works perfectly as I expected now! Thank you very much!
     
  15. Asse1

    Asse1

    Joined:
    Jan 9, 2013
    Posts:
    89
    Hey,

    despite of using Unity for our Android and iOS applications we also have a Mono server running which communicates with our clients. Now we've bought this plugin since we've encountered irregular problems when downloading savegames from our server to the client (download size is between 11kB and 600kB).

    Of course I'll implement BestHTTP on the client but I'd also like to test this library on our server.

    Now my question is, does this library depend too strong on the UnityEngine library or can it be removed without changing too much code? I've noticed that Unity seems to be only used on top level.
     
  16. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @andermon

    Unfortunately currently there are no easy and obvious way to differentiate.
     
  17. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @light530

    Great, this fix will be included in the next release, you will be able to update the plugin from the Asset Store as usual.
     
  18. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @Asse1

    I think there are only two dependencies:
    1. The default logger implementation uses Unity's Debug.Log functions.
    2. The HTTPUpdateDelegator is inherited from MonoBehaviour, but it has only three distinct tasks(but you can clean up this class from the Unity engine dependency easily too):
      1. Call setup functions in its Setup function.
      2. Call HTTPManager.OnUpdate(); regularly.
      3. Tear down the plugin when quitting.
     
  19. Asse1

    Asse1

    Joined:
    Jan 9, 2013
    Posts:
    89
    Ok, good to know. I've also seen that HTTPResponse and HTTPRequest contain some Unity code but I guess it's only used for convenient functionality like retrieving a Texture2D object directly etc.

    I'll give it a try, thanks!
     
  20. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @Asse1

    Yeah, forgot about them, sorry.
    1. For WWWForm, you can add the BESTHTTP_DISABLE_UNITY_FORM compiler directive and remove the SetFields function in HTTPRequest.cs.
    2. As you guessed the Texture2D is just a shortcut, it can be removed safely, only the examples are using it.
     
  21. andermon

    andermon

    Joined:
    Aug 29, 2016
    Posts:
    14
    Thank you for the fast responce.

    I have done some more testing, without using the proxy settings I get
    No connection could be made because the target machine actively refused it

    and when I have the Proxy settings added I still get the same message, No connection could be made because the target machine actively refused it

    I know that my proxy settings are correct as I use them in IE and Chrome, and I have used the C# .Net HttpWebStream Module to create a simple proxy connection that has gone through the proxy.

    Code (CSharp):
    1.         private void WebPOSTProxy(string postURL, WWWForm form)
    2.         {
    3.             Config.Instance.ActiveProxy = false;
    4.             HTTPRequest request = new HTTPRequest(new Uri(postURL),
    5.                                                   HTTPMethods.Post,
    6.                                                   OnRequestFinished);
    7.             request.RawData = form.data;
    8.             request.Proxy = new HTTPProxy(new Uri("http://****.******.***:8080"));
    9.             request.Send();
    10.  
    11.         }

    Can you think of anything that I may have to set in BestHTTP, that I might of left out.

    If I remove the .Proxy and switch to our other wireless connection that is for testing and doesn't go through the proxy everything works correctly.

    Any help would be greatly appreciated, as this the main reason for the purchase of BestHTTP Pro. Is the ability to go through our corporate proxy.


     
    Last edited: Sep 5, 2016
  22. andermon

    andermon

    Joined:
    Aug 29, 2016
    Posts:
    14
    Is there the ability to read in a proxy file from a remote location, like IE,Chrome, Win10?

    I was wondering how are you setting up the connection for the proxy? I was taking a look and saw the header "proxy-connection" and am wondering if this is how you are handling the proxy connections. I was doing some investigating using postman and that in the header and I recieved an error. I was wondering if you wouldn't mind shedding some light on how you are handling the proxies.
     
    Last edited: Sep 5, 2016
  23. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @andermon

    These errors are thrown when the target machine has no service on the given port.
    Is it possible to send me the proxy address so I can test it out?
    Also, setting the log level of the plugin may print out something useful:
    Code (CSharp):
    1. HTTPManager.Logger.Level = Loglevels.All;
    "Is there the ability to read in a proxy file from a remote location, like IE,Chrome, Win10?"
    The plugin can't do it currently.

    "I was wondering how are you setting up the connection for the proxy? I was taking a look and saw the header "proxy-connection" and am wondering if this is how you are handling the proxy connections."

    The HTTPConnection will connect to the proxy if set, or the target server.
    The Proxy-Connection header will inform the proxy to keep the connection alive, as we probably want to send out multiple requests through it. It will be sent only when the connection between the proxy and the client established successfully. Some proxies use this header the same as the Connection header.
     
  24. andermon

    andermon

    Joined:
    Aug 29, 2016
    Posts:
    14
    @BestHTTP

    Thanks for the code and info. I have stripped out all the game information and have now been doing just a test around BestHTTP and the most basic of information. I have some progress, especially with that debugging line you provided.

    I now get a I[HTTPConnection]: Connected to ****.*****.****:8080 <- the proxy is getting hit :)

    Which is great to know that it is hitting the proxy and connecting correctly, I am getting an error though, which is pretty weird. The error is W[HTTPResponse]: No Content-Length or Chunked Transfer-Encoding! Reading for unknown size.

    If I disable the proxy section in my code and switch to the wireless connection that doesn't go through the proxy it all works 100%.

    I am unable to give out the proxy data sadly, but atleast now I know it is getting hit correctly.

    The following is the test I wrote up to check the connection on a network that has a proxy and hasn't got a proxy.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using BestHTTP;
    5.  
    6. public class ProxyTest : MonoBehaviour
    7. {
    8.     string url = "https://login.microsoftonline.com/a3299bba-ade6-4965-b011-bada8d1d9558/oauth2/token";
    9.     Dictionary<string, string> url_header = new Dictionary<string, string>();
    10.  
    11.     string proxy_url = "*****.******.***";
    12.     int proxy_port = 8080;
    13.  
    14.  
    15.     bool PROXY_ACTIVE = true;
    16.  
    17.  
    18.     void InitHeaders()
    19.     {
    20.         url_header.Add("grant_type", "password");
    21.         url_header.Add("client_id", "***********");
    22.         url_header.Add("username", "***********");
    23.         url_header.Add("password", "***********");
    24.         url_header.Add("resource", "***********");
    25.     }
    26.  
    27.  
    28.     void SetupProxy()
    29.     {
    30.         InitHeaders();
    31.         System.UriBuilder uriB = new System.UriBuilder();
    32.         HTTPManager.Logger.Level = BestHTTP.Logger.Loglevels.All;
    33.         HTTPRequest request = new HTTPRequest( new System.Uri(url),
    34.                                                HTTPMethods.Post,
    35.                                                OnRequestComplete
    36.                                                );
    37.  
    38.         request.AddHeader("Content-Type", "x-www-form-urlencoded");
    39.  
    40.         foreach(KeyValuePair<string,string> kvp in url_header)
    41.         {
    42.             request.AddField(kvp.Key, kvp.Value);
    43.         }
    44.  
    45.         if (PROXY_ACTIVE)
    46.         {
    47.             uriB = new System.UriBuilder();
    48.             uriB.Host = proxy_url;
    49.             uriB.Port = proxy_port;
    50.             uriB.Scheme = "https"; // I have tried with http and https, and with IsTransparent set to false
    51.             HTTPProxy prx = new HTTPProxy(uriB.Uri);
    52.  
    53.             prx.IsTransparent = true;
    54.  
    55.             request.Proxy = prx;
    56.         }
    57.  
    58.         request.Send();
    59.  
    60.     }
    61.  
    62.  
    63.     private void OnRequestComplete(HTTPRequest request, HTTPResponse responce)
    64.     {
    65.         if (request.State == HTTPRequestStates.Error)
    66.         {
    67.             UnityEngine.Debug.LogError(request.Exception.Message);
    68.         }
    69.         if (responce != null)
    70.         {
    71.             print(responce.DataAsText);
    72.         }
    73.     }
    74.  
    75.     // Use this for initialization
    76.     void Start ()
    77.     {
    78.         SetupProxy();
    79.     }
    80. }
    81.  
    82.  
    I have also used telnet to access the proxy and checked that it is handling HTTP/1.0 and HTTP/1.1 correctly.
     
    Last edited: Sep 6, 2016
  25. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @andermon

    Thanks, we made progress without the proxy address to. That warning means that the proxy response came without any length information, so the plugin doesn't know how much data it should read.
    There are two kind of read method implemented for this case. Switching to the other one may help. You have to set the requests' EnableSafeReadOnUnknownContentLength to false.
     
  26. andermon

    andermon

    Joined:
    Aug 29, 2016
    Posts:
    14
    Thank you so much! it is all working now :) Wish I could give a 6/5 for customer care and plugin performance.

    Im hitting my endpoint through the proxy, and getting information returned. I then have a whole bunch of calls that get initialised depending on what the user selects. Each time I create a request, and when the data is dl I close the request.

    I seem to be having an error after my first request. The first url goes through and is returned perfectly with all the data correctly. The second query to go through gets a "TLS error this could be an attack" when UseAlternateSSL is enabled, I have changed the UseAlternateSSL to false and then I get a "BeginWrite failure" by any chance do you know what might be occuring. and this only happens when going through the proxy, if proxy is disabled like the example above it all works. :/ man networking is tricky, baby steps forward :)
     
    Last edited: Sep 8, 2016
    BestHTTP likes this.
  27. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @andermon

    Hmm, might be that the proxy closes the connection even we inform to keep it alive. You can tell the plugin to reconnect for every request. You can set it globally:
    Code (CSharp):
    1. HTTPManager.KeepAliveDefaultValue = false;
    or per-request:
    Code (CSharp):
    1. request.IsKeepAlive = false;
     
  28. andermon

    andermon

    Joined:
    Aug 29, 2016
    Posts:
    14
    Thank you for all the help, it is all working. We had a bad end point, which I have codded up some exceptions for when the proxy needs to be added to specific endpoints.

    Your plugin is a life saver! :D

    Will you be implementing smb:// protocol in your plugin?
     
    Last edited: Sep 13, 2016
    BestHTTP likes this.
  29. light530

    light530

    Joined:
    Aug 30, 2016
    Posts:
    12
    Hello, when will the new version release?
    Because I may need to have a release build as soon as possible.
     
  30. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @light530 Planned to upload the new version last week, but I fallen sick. I still feel myself bad, but I will upload it today to the Asset Store. It should be released by them this week.
     
  31. light530

    light530

    Joined:
    Aug 30, 2016
    Posts:
    12
    Oh... Take care.
    Thank you very much.
     
  32. monitaQ

    monitaQ

    Joined:
    Aug 19, 2013
    Posts:
    2
    I have implemented a 'ICertificateVerifyer' as mentioned in the docs and this thread, but the 'isValid' method is not consistently called - sometimes it never gets called.

    Is this known about? How can I get it to consistently be called? Could overlapping requests (with a different HTTPRequest object) be interfering?

    Thanks for any help.
     
  33. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @monitaQ

    It's possible to be called once for multiple requests because of connection pooling. But it should be called at least once.
    Is it possible that you can send me a repro-project?
     
  34. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @light530 v1.9.14 is out now in the Asset Store.
     
  35. byron_pap

    byron_pap

    Joined:
    Apr 16, 2015
    Posts:
    6
    Hi,
    I'm having issues with Android builds now. (Unity 5.4)
    I've tested with the private beta as well as the new public version 1.9.14 on the asset store.

    adb logcat is giving me null reference errors for any HTTP requests using BestHTTP.

    upload_2016-9-19_11-37-49.png

    Known issue like the previous WebGL bug? Or something weird happening?

    Thanks, Byron
     
  36. light530

    light530

    Joined:
    Aug 30, 2016
    Posts:
    12
    Thank you. I saw the update in Asset Store.
    But I found that all the BestHTTP.dll in the Precompiled.zip are no difference with previous version?
     
  37. monitaQ

    monitaQ

    Joined:
    Aug 19, 2013
    Posts:
    2
    @BestHTTP It seems that if the first call to the server does not use a CustomCertificateVerifyer, but a subsequent one does, isValid will not get called (maybe because of the connection pooling you mentioned?). Unfortunately I cannot provide a sample to demonstrate this.
     
  38. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @byron_pap

    I'm not aware of any issue on android. Are you checking the status of the request in your callback?
    Something like this:
    Code (CSharp):
    1. Uri uri = new Uri(address);
    2.  
    3. HTTPRequest request = new HTTPRequest(uri, (req, resp) =>
    4. {
    5.     switch (req.State)
    6.     {
    7.         // The request finished without any problem.
    8.         case HTTPRequestStates.Finished:
    9.             if (resp.IsSuccess)
    10.             {
    11.                 Debug.Log("Request Finished Successfully! Data : " + resp.DataAsText);
    12.             }
    13.             else // Internal server error?
    14.                 Debug.LogWarning(string.Format("Request Finished Successfully, but the server sent an error. Status Code: {0}-{1} Message: {2}",
    15.                                                 resp.StatusCode,
    16.                                                 resp.Message,
    17.                                                 resp.DataAsText));
    18.             break;
    19.  
    20.         // The request finished with an unexpected error. The request's Exception property may contain more info about the error.
    21.         case HTTPRequestStates.Error:
    22.             Debug.LogWarning("Request Finished with Error! " + (req.Exception != null ? (req.Exception.Message + "\n" + req.Exception.StackTrace) : "No Exception"));
    23.             break;
    24.  
    25.         // The request aborted, initiated by the user.
    26.         case HTTPRequestStates.Aborted:
    27.             Debug.LogWarning("Request Aborted!");
    28.             break;
    29.  
    30.         // Connecting to the server is timed out.
    31.         case HTTPRequestStates.ConnectionTimedOut:
    32.             Debug.LogError("Connection Timed Out!");
    33.             break;
    34.  
    35.         // The request didn't finished in the given time.
    36.         case HTTPRequestStates.TimedOut:
    37.             Debug.LogError("Processing the request Timed Out!");
    38.             break;
    39.     }
    40. });
    41.        
    42. request.Send();
    Also, you can change logging levels of the plugin:
    Code (CSharp):
    1. BestHTTP.HTTPManager.Logger.Level = BestHTTP.Logger.Loglevels.All;
    These may help to get closer what happens.
     
  39. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @light530

    It should be. Just downloaded the plugin from the store and the time stamp on the precompiled.zip and dlls are set to 2016.09.13. It was the date when i compiled them and uploaded the package to the store.
     
  40. byron_pap

    byron_pap

    Joined:
    Apr 16, 2015
    Posts:
    6
    It works fine in the editor and other platforms, just not on an Android build.

    I've added in the callback with the status but getting this from adb logcat after I build it. It's 2 separate requests just to double check. The logger works in the Editor and is outputting all the correct info but nothing more than the Debug.Log commands are coming through on adb logcat.

    upload_2016-9-19_22-43-37.png


    Just to make sure it's not me misunderstanding the upgrade guide... with version > 1.9 do I have to manually add in any .dll's or is it all included in the source now?
    If this is the case I've tried to add in the Plugins folder from the precompiled.zip file and getting build errors
    upload_2016-9-19_22-54-50.png
     
    Last edited: Sep 19, 2016
  41. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @byron_pap

    Thanks, that looks like a stripping issue. What's your Player settings/Api Compatibility Level and Stripping Level?
    There is a link_android_subset.xml that you can try to rename to link.xml and try to make a new build.

    dlls from the precompiled.zip isn't needed by default, you should delete them from your plugins folder.
     
  42. byron_pap

    byron_pap

    Joined:
    Apr 16, 2015
    Posts:
    6
    Thank you @BestHTTP ! It was just a stripping issue after all.
     
  43. jhnissin

    jhnissin

    Joined:
    Sep 7, 2015
    Posts:
    27
    @BestHTTP

    Hey,

    We are having a problem with Best HTTP Pro v 1.9.14 using Unity 5.4.1p1 reporting a TLS issue with our production server, however, in the browser the server certificate and connection seems fine. The error keeps appearing randomly and is independent of the API endpoint we are using. After adding some logging I gathered that the error is interpreted as decryption_failed (21) and the cause seems to be a fatal error (2) due to an illegal parameter (47). The application was working fine with our development server, but we began having issues after switching to our production server that is behind a firewall/load balancer.

    Here is an example stack trace of an error situation:

    HTTPUtilsException: HTTPUtils HTTPRequestAsObservable: Request to ****** finished with unexpected error.
    Error message: Internal TLS error, this could be an attack
    Stack trace: at Org.BouncyCastle.Crypto.Tls.TlsProtocol.ProcessAlert () [0x00052] in /Users/jnis/Documents/code/work/helsinki-airport-unity/Assets/Plugins/Best HTTP (Pro)/BestHTTP/SecureProtocol/crypto/tls/TlsProtocol.cs:385
    at Org.BouncyCastle.Crypto.Tls.TlsProtocol.ProcessRecord (Byte protocol, System.Byte[] buf, Int32 offset, Int32 len) [0x00033] in /Users/jnis/Documents/code/work/helsinki-airport-unity/Assets/Plugins/Best HTTP (Pro)/BestHTTP/SecureProtocol/crypto/tls/TlsProtocol.cs:242
    at Org.BouncyCastle.Crypto.Tls.RecordStream.ReadRecord () [0x000ab] in /Users/jnis/Documents/code/work/helsinki-airport-unity/Assets/Plugins/Best HTTP (Pro)/BestHTTP/SecureProtocol/crypto/tls/RecordStream.cs:161
    at Org.BouncyCastle.Crypto.Tls.TlsProtocol.SafeReadRecord () [0x00000] in /Users/jnis/Documents/code/work/helsinki-airport-unity/Assets/Plugins/Best HTTP (Pro)/BestHTTP/SecureProtocol/crypto/tls/TlsProtocol.cs:491
    UniRx.Stubs.<Throw>m__CD (System.Exception ex) (at Assets/Plugins/UniRx/Scripts/Observer.cs:270)
    UniRx.Observer+Subscribe`1[PSCLoginRefreshResponse].OnError (System.Exception error) (at Assets/Plugins/UniRx/Scripts/Observer.cs:142)
    UniRx.Operators.FinallyObservable`1+Finally[PSCLoginRefreshResponse].OnError (System.Exception error) (at Assets/Plugins/UniRx/Scripts/Operators/Finally.cs:59)
    UniRx.Operators.DeferObservable`1+Defer[PSCLoginRefreshResponse].OnError (System.Exception error) (at Assets/Plugins/UniRx/Scripts/Operators/Defer.cs:53)
    UniRx.Operators.ThrowObservable`1+Throw[PSCLoginRefreshResponse].OnError (System.Exception error) (at Assets/Plugins/UniRx/Scripts/Operators/Throw.cs:58)
    UniRx.Operators.ThrowObservable`1[PSCLoginRefreshResponse].SubscribeCore (IUniRxObserver`1 observer, IDisposable cancel) (at Assets/Plugins/UniRx/Scripts/Operators/Throw.cs:23)
    UniRx.Operators.OperatorObservableBase`1[PSCLoginRefreshResponse].Subscribe (IUniRxObserver`1 observer) (at Assets/Plugins/UniRx/Scripts/Operators/OperatorObservableBase.cs:34)
    UniRx.Operators.CatchObservable`2+Catch[PSCLoginRefreshResponse,System.Exception].OnError (System.Exception error) (at Assets/Plugins/UniRx/Scripts/Operators/Catch.cs:73)
    UniRx.Operators.ObserveOnObservable`1+ObserveOn_[PSCLoginRefreshResponse].OnError_ (System.Exception error) (at Assets/Plugins/UniRx/Scripts/Operators/ObserveOn.cs:164)
    UniRx.Scheduler+MainThreadScheduler+QueuedAction`1[System.Exception].Invoke (System.Object state) (at Assets/Plugins/UniRx/Scripts/UnityEngineBridge/MainThreadScheduler.cs:177)
    UniRx.InternalUtil.ThreadSafeQueueWorker.ExecuteAll (System.Action`1 unhandledExceptionCallback) (at Assets/Plugins/UniRx/Scripts/InternalUtil/ThreadSafeQueueWorker.cs:81)
    UnityEngine.Debug:LogException(Exception)
    UniRx.MainThreadDispatcher:<unhandledExceptionCallback>m__105(Exception) (at Assets/Plugins/UniRx/Scripts/UnityEngineBridge/MainThreadDispatcher.cs:350)
    UniRx.InternalUtil.ThreadSafeQueueWorker:ExecuteAll(Action`1) (at Assets/Plugins/UniRx/Scripts/InternalUtil/ThreadSafeQueueWorker.cs:85)
    UniRx.MainThreadDispatcher:Update() (at Assets/Plugins/UniRx/Scripts/UnityEngineBridge/MainThreadDispatcher.cs:545)

    Is this a familiar issue at all and is there anything I could do to fix this or debug this further? I can provide links to possible endpoints e.g. via email.
     
  44. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @jhnissin

    Is it possible that a servers behind the load balancer have different certification? Is the firewall and or the load balancer do any ssl offloading too?

    What I can think that might solve these errors:
    1.) Lower the MaxConnectionIdleTime as it helps with similar issues:
    Code (CSharp):
    1. HTTPManager.MaxConnectionIdleTime = TimeSpan.FromSeconds(10);
    2.) Disable connection pooling completely:
    Code (CSharp):
    1. HTTPManager.KeepAliveDefaultValue = false;
    3.) Use the default ssl handler:
    Code (CSharp):
    1. HTTPManager.UseAlternateSSLDefaultValue = false;
    If you can send an endpoint in an email it might be useful too.
     
  45. jhnissin

    jhnissin

    Joined:
    Sep 7, 2015
    Posts:
    27
    @BestHTTP

    I tried the settings you suggested, I think the problem happens a bit more rarely now, however it still exists. AFAIK the load balancer handles SSL termination so it's serving unencrypted traffic to the servers in the internal network. I don't have direct access to the server myself so I can't say more than that. I'll send you an email with a couple of endpoints that don't require authentication.

    Also, we are using our own ICertificateVerifier implementation to verify the server certificates. We would be more than happy to give it up if there is a ready-made and better tested way to validate server side certificates against a set of root certificates provided either by us or by the platform on Android, iOS and Windows.

    I doubt this is the issue, though as the error isn't coming from our certificate validation? If our verifier failed a certificate it would show up in our logs.

    And huge thanks for the super fast response! :)
     
  46. marteus

    marteus

    Joined:
    Jul 17, 2015
    Posts:
    4
    @BestHTTP

    I'm seeing a build size increase of ~6MB and 5 minutes added to build time on iOS after integrating the plugin. Is this normal?
    I'm using version v1.9.14 and I have disabled all possible features with these defines:
    BESTHTTP_DISABLE_COOKIES;BESTHTTP_DISABLE_SERVERSENT_EVENTS;BESTHTTP_DISABLE_WEBSOCKET;BESTHTTP_DISABLE_SIGNALR;BESTHTTP_DISABLE_SOCKETIO;BESTHTTP_DISABLE_UNITY_FORM

    NOTE: The BESTHTTP_DISABLE_CACHING caused the project to not compile:
    Assets/Best HTTP (Pro)/BestHTTP/HTTPResponse.cs(926,53): error CS1061: Type `BestHTTP.HTTPResponse' does not contain a definition for `IsFromCache' and no extension method `IsFromCache' of type `BestHTTP.HTTPResponse' could be found (are you missing a using directive or an assembly reference?)
     
  47. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @jhnissin

    Thanks for the links. I tried to reproduce it with one of the end point, but I wasn't able yet.
     
  48. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @marteus

    The plugin contains a 3rd party lib to handle HTTPS connections as the default mono implementation came from Unity proved to be outdated. It's still possible that it will be handle your connections, so you can fall back to that implementation by defining BESTHTTP_DISABLE_ALTERNATE_SSL too. This should lower the build time and size.

    Alternately you can use the dlls in the \Best HTTP (Pro)\Precompiled.zip. In this case, you have to delete the \Best HTTP (Pro)\BestHTTP folder.
     
  49. -chris

    -chris

    Joined:
    Mar 1, 2012
    Posts:
    99
    Hello @BestHTTP

    Does Best HTTP Pro support socket.io Rooms?
    I see you support Namespaces but I haven't found any info about Rooms.
    Considering purchasing, but just wanted to check!
     
  50. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @-chris

    No, rooms aren't supported.