Can I do asynchronous web access?

Is it possible to create HTTPS connection and read/write from the stream without blocking current thread? Or I have to work with something like libuv or libcurl?

In addition, I searched some HTTPS client solutions like libcurl or libuv+hand-written code, all of them requires openssl to perform CA authentication and encrypt/decrypt works. In contrast, JUCE supports HTTPS but don’t depend on openssl explicitly. How does JUCE do that?

For sure, you can (and should) inherit from juce::Thread or use std::thread for the network part, and then use juce::MessageManager::callAsync to merge the result back to the message thread.

Re:HTTPS, the juce URL class supports it (I think?) using platform specific APIs, you can see what happens if you use an https address when calling createInputStream() on a juce::URL.

1 Like

Here is a repo worth looking at for extra networking tools: GitHub - FigBug/Gin: A few extras for juce

1 Like