Best HTTP Released

Hello everyone,

Today marks a significant milestone for the Best HTTP toolkit as I unveil a new era of modularization for our beloved networking suite. This evolution stems from a desire to enhance your experience by simplifying integration, minimizing project size, and offering more cost-effective solutions.

What’s New?
Instead of the all-in-one Best HTTP/2 package, you now have the option to select from individual packages tailored to your specific needs:

  • Best HTTP: The core package for all your HTTP needs.
  • Best Server-Sent Events: Tailored exclusively for server-sent events.
  • Best WebSockets: The definitive choice for WebSocket communication.
  • Best Socket.IO: A package dedicated to Socket.IO integration.
  • Best SignalR: Optimally designed for SignalR interactions.

And for those of you utilizing MQTT or requiring enhanced security, the Best MQTT and Best TLS Security packages continue to be available.

Dependencies:
All these new modular packages depend on Best HTTP at their core. Most will also require Best WebSockets to harness the full scope of their real-time capabilities as their transport.

Introducing Bundles:
To simplify your experience and provide value, each of these packages is also available as part of a bundle that includes all necessary dependencies::

Why Go Modular?

  • Simplicity: Easier integration with only the components necessary for your project.
  • Smaller Footprint: A leaner toolkit means a lighter load for your applications.
  • Affordable Options: Pay only for what you need, when you need it.
  • Dedicated Improvements: Quicker, more targeted updates and maintenance.

Existing Users: If you’ve been using the Best HTTP/2 package, you might wonder about the transition process. I’ve put together a detailed migration guide to help you adapt smoothly and effectively.

New Users: If you’re new to Best HTTP, welcome aboard! With modular packages, you can now tailor your toolkit to your project’s precise requirements from the outset.

Moving Forward:

  • Upgrade Guide: Consult the migration guide for a seamless switch to the new packages.
  • Support: As always, I am here to assist you every step of the way.
  • Feedback: Your input is invaluable. Please share your thoughts on these changes!

I’m genuinely excited about what these new modular packages will mean for your projects, enhancing your ability to create with greater agility and precision. For more details on each package, please visit the Documentation Page, or start your migration using the Upgrade Guide.

Thank you for your trust in my work, and I eagerly anticipate the amazing projects you’ll craft with these new tools.

Warmest regards,
Tivadar

1 Like

got demo apk on the streaming?

Hi imtrobin.

You can download the demo apk here, and you can check the code directly here.
The interesting codes are located in the StartDownload and in the OnfragmentDownloaded functions.

If you have any more questions feel free to ask here or at the besthttp@gmail.com email address.

The DownloadStreamingTestScene only plays audio? It loads fine and I hear music and when it pause, I press Play again and it crashes.

Hi imtrobin,

That’s a strange behavior, I never seen that.
And yes, it’s only plays audio, but i should remind you, it’s not a production ready audio streaming code so there might be bugs and - as you experienced - crashes.
The main purpose was to demonstrate the streaming capabilities of the plugin.

I will try to reproduce that crash, but I’m very confident that it’s not occurred in the HTTP plugin rather than in the demo code.

Edit: Streaming audio was my only idea to demonstrate streaming using a http plugin somehow spectacularly. Downloading a file and displaying only a download indicator is boring. :slight_smile:
But if someone can suggest me a good idea that is good for a little demo, that would be welcome.

streaming video would be good. after all, that’s the purpose of what we want to stream.

Yes video streaming would be better, but making a crossplatform video streaming demo would produce more obfuscated demo code, and i think the current audio streaming sample is already too complex for a lightweight demonstration.
The MovieTexture is desktop (and i think webplayer) only. The Handheld.PlayFullScreenMovie is iOS and Android only. And I’m curious about the Windows Phone 8 support, as I’m supporting this new mobile platform too.
Plus i don’t know how these would react when they need to play from an incomplete file, as they can play only from a file or from an url(this case that would be a very bad streaming demo:)).
In a real product there should be (native) plugins to handle the video playing per platform, but for just a demo that would be too much work.

agreed. but the whole idea of streaming is for video. I can’t think of any other purpose. If it’s downloaded, I could just use assetbundle or Unity www.

Well, i agree but streaming video is just one thing, the main point behind streaming is getting data before the download ends.

  • So streaming can be used for downloading larger files and resume the download if your app closed or disconnected from the internet. (Write out to disk the downloaded fragments and resume with a Range request.)
  • Or you can start processing the response for a long-polling request.
  • You can start download (a maybe larger) leaderboard and show players that already downloaded. The response can be cached on the user’s device and next time this cached response can be used if the leaderboard doesn’t changed.
    This can be done with a simple request. You don’t need to write code to handle the caching and validation of the cache. You just need a simple download request and set up the server to send back last-modified or eTag headers and handle the cache validation.
    This way you achive better user experience, spare user and server bandwith and spare processing power on the server too.

So while i agree that when streaming is read the first thing to come in mind is video, but with a little creativity it can be very useful in other areas too.
And now with my plugin it can be easy too. :wink:

Hi, Before I buy this plugin, I just want to confirm if Best HTTP can do the following:

  • Use REST API with PUT method
  • Use REST API with DELETE method
  • Modify / add HTTP headers (just like in curl -H)
  • Change HTTP request Content-Type
  • Add HTTP POST Data (just like in curl -d)
  • Compatible with Unity 3.5.x
  • Socket.IO compatibility
  • I have an assumption that basic version will supports all the Pro features when it is released, just minus the source code?

Thanks!

Hi avatech,

Thank you for you interest!

These are all supported right now.

Unity 3.5.7 support is waiting for approval in the Asset Store, should be out this week.

Scoket.IO is not supported now.

Yes, your assumptions are right.

I hope you will find the best tool for your needs!

Wow, thanks for the fast reply. I’ll buy this as soon as the 3.5.7 support is up!

Hi avatech,

Thank you for your patience.

I’m happy to announce that Best HTTP Pro is live, and the update for the Basic edition is out too.
They both supports Unity 3.5.7.

These are stuck in my head, so i added another demo scene to the collection: LeaderboardTest. The android demo updated too.
The server side is a little Ruby code using the Sinatra framework:

get '/LeaderboardTest/:from/:count' do |f, c|
    from = f.to_i
    count = c.to_i
 
    # Set 'Expires' header to the current Time + 1 minute
    headers 'Expires' => (Time.now + 60).utc.httpdate.to_s
 
    # Create the leaderboard stream and write out 10 player
    stream do |out|
        count.to_i.times do |pos|
            out << "Player_Name_#{(from + pos).to_s};#{(from + count - pos) * 100}\n"
 
            # Here is the streaming magic. :)
            sleep 0.5
        end
    end
end

If you open the leaderboard url there is a high chance that your browser will display the result only when all data downloaded.
In the demo app, the leaderboard will display continuously the received players. The result will be cached, and used while it’s not expires(1 min).

Yesterday i started to read the specification of the Basic and Digest authentication.
The Basic is already done.
I hope i will finish before the end of the week and i can send the update to the Asset Store.

And if i finish these very quickly, maybe the proxy authentication will be in this update too.

Both type of authentication done now. Setting up a request to use authentication can be done by one easy step: setting it’s Credentials property.
An example can be seen here:

var request = new HTTPRequest(new Uri("https://httpbin.org/digest-auth/auth-int/user/passwd"), (req, resp) =>
        {
            if (resp.StatusCode != 401)
                Debug.Log("Authenticated");
            else
                Debug.Log("NOT Authenticated");
        });

request.Credentials = new Credentials("user", "passwd");
request.Send();

For proxy authentication i need to set up a proxy server to test my code, but otherwise its should be ok too.
Last week’s update still pending in the asset store, but should be out in the next one or two days, after that i will submit this update to the asset store.

Bought the plugin a few days ago and it’s working great.

In our next project, however, we need to use websockets.
I saw in the documentation that you’re planning to add support for it. My question is, that when this feature will be available? Are you planning to release it in the near future?

Hi Gundoglu,

Thank you for your kind words.

Regarding the WebSocket support: I will start to implement it in the coming weeks, so when you will start to develop your next game it will be ready for you. :slight_smile:

Hey, thanks for the fast answer.

We’re still just planning what to use so you definitely have a few more weeks to add this. :slight_smile:

New update uploaded to the Asset Store, will be out next week:

  • [New Feature] Basic and Digest authentication support through a new Credentials property in the HTTPRequest class
  • [Improvement] More then one redirection supported for a single request
  • [Improvement] New MaxRedirects property in the HTTPRequest class
  • [Improvement] New GetFirstHeaderValue(string headerName) function in the HTTPRequest class
  • [Improvement] New optimized parsers, for now only used for parsing the authentication header
  • [Improvement] Some code cleanup
  • [Bugfix] In some cases after sending the request and not receiving any data caused a new reconnect
  • [Bugfix] Some caching proxies return with float values in Max-Age header

A quick sample how you can use the new authentication:

var request = new HTTPRequest(new Uri("https://httpbin.org/digest-auth/auth-int/username/password"), (req, resp) =>
{
  if (resp.StatusCode != 401)
    Debug.Log("Authentication successful");
  else
    Debug.Log("Authentication Failed");

  Debug.Log(resp.DataAsText);
});

request.Credentials = new Credentials("username", "password");
request.Send();