I’m trying to open a network connection between my audio plugin and a web server (for one-time license activation). Right now I’m using a local web stack (MAMP) for testing.
I’m using WebInputStream as follows:
WebInputStream inputStream(URL("http://localhost:8888/test.php").withPOSTData(JSON::toString(data)), true);
var response = JSON::parse(inputStream.readString());
But my PHP script never receives the request. I’ve of course double checked that the URL works in a web browser, and I also successfully tested the PHP script using Postman.
I tried calling ìnputStream.connect(), but it doesn’t make any difference.
I’m on Mac, so I also enabled the com.apple.security.network.client entitlement.
mkcert automatically creates and installs a local CA in the system root store, and generates locally-trusted certificates. mkcert does not automatically configure servers to use the certificates, though, that’s up to you.
After that when you press the “play” button in XCode (or use Cmd-R) you will be asked which program you want to start, choose your DAW and then you’ll see the debug output at the bottom of XCode window, you may need to activate the console:
Add your plugin to the DAW as normal and you’ll see any debug from it (you might also see a load of other stuff from the DAW itself which you can ignore).
I managed to create a self-signed certificate for MAMP by following instructions here. And as soon as I switched to https, everything started working as expected!