I use C++ and Qt 5.15.x. I've built WebAssembly version of my desktop application. The application is loaded using URL like "http://192.168.21.55:5555" (intranet application). I'd like to extract server IP address within WebAssembly application. How can I achieve it?
There is no solution for ip extraction, but I've found the way to get host and port (host is equal to ip in my case).
#include <emscripten/val.h>
emscripten::val location = emscripten::val::global("location");
auto host = QString::fromStdString(location["host"].as<std::string>());
auto port = QString::fromStdString(location["port"].as<std::string>());