Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Get URL / local IP in Qt WASM
Ollie_A last edited by
To clarify what I'm doing it for, I have a chat client and, not relevant for this task, a chat server. The chat client will always be downloaded from a web server running on the same IP as the chat server (on different hardcoded ports). I don't want a user to need to input the IP, as it will always be the same IP as the one it's just downloaded the client from.
Any ideas on how to go about this?
ocgltd last edited by
@Ollie_A Although 1.5 years old, did you ever solve this? I'm trying to figure out the same
Karmo last edited by
#include <emscripten/val.h> ... emscripten::val location = emscripten::val::global("location"); auto host = location["hostname"].as<std::string>(); auto port = location["port"].as<std::string>();