When I execute request my requestCB function never gets called.
This is the minimum viable test of fsNetworkHttpRequestGet I can come up with but it still doesn’t work.
I read the documentation but it’s doesn’t provide much help fsNetworkHttpRequestGet
Does anyone know what’s wrong here?
To be honest I suspected it because getting https://www.google.com/ does work.
But I never imagined it was the intended design. I thought it was more likely a bug.
Even the function name fsNetworkHttpRequestGet has the Http acronym and not Https. And the documentation says nothing about https.
I echo @tracernz , Why?
Isn’t my described setup of a WASM module requesting from a local server valid?
Yep, it is a problem when creating local apps and is not worth the effort. I tried to use the Network API in my hobby project to communicate between my WASM module and my external EXE and therefor created a self signed certificate to be able to listen to https requests but that introduces a lot of security issues so I decided to use SimConnect instead.
I just tried setting up a self signed certificate but even that failed. Only valid certificates from certificate authorities seem to work.
Thanks for the suggestion @Swede001
I’ll try using SimConnect instead though I originally didn’t go for it because I couldn’t find a way to send events (button presses) from JS to an external SimConnect exe.
Lol the ability to use websockets and http requests from html/js is the most powerful API in the game by a huge margin. Without that we’d be c.1980’s multiplexing complex data in the sim into stacks of 64-bit L vars just to try and get strings or structured data types through.
It’s possible the JS http support will die followed by a statement that it has never been a supported feature in the sim.
Hi, yes you can pass structured data through SimConnect, for example a struct containing a mix of ints, doubles and strings. Not sure if it is possible from JS though but when communicating between a WASM module and an external EXE it is absolutely possible.
If you’re able to run a web server in your app, you can use either regular HTTP calls (fetch), or websockets from a JS instrument. It doesn’t need HTTPS, but does need correct CORs headers for some things.
For SimConnect and WASM instruments you can use client data areas to send structured data back and forth.