diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2021-10-01 13:11:41 +0200 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2021-12-15 17:06:11 +0100 |
commit | 76d12eea2252c5e537dff15b103bdc1f925cf760 (patch) | |
tree | 30bf5a17f560268d334cfa46228639f0ab77c68e /src/network/kernel/qhostinfo_p.h | |
parent | 292bdac4cfaebcc905975aa0cdc2f87782c389f6 (diff) |
wasm: implement host lookup for socket tunneling
Emscripten implements support for tunneling TCP and
UDP sockets through a WebSockets connection. This support
is implement for the BSD sockets API, which means that
Qt’s existing socket classes can be used, with some
adjustments.
For example, the flow for making a TCP connection to
example.com:1515 can look like this:
1) The application resolves “example.com”.
Emscripten creates an internal mapping to a private
IP and returns that IP: 172.29.1.0.
2) The application connects to 172.29.1.0:1515.
Emscripten makes a WebSocket connection to example.com:1515,
and forwards the TCP data over this connection
3) On example.com:1515, a WebSockify intermediate server
accepts the WebScoket connection and forwards the
TCP data to the target sever, as specified by the
WebSockify configuration.
Emscripten’s local getaddrinfo() implementation is fast,
which means don’t need caching or the thread pool. Instead,
special-case lookupHostImpl() for Q_OS_WASM. The implementation
calls QHostInfoAgent::lookup() and then posts resultReady
using QHostInfoResult.
Change-Id: Iaf31efb701ae7cc11752a63cc6b8346d4f09107e
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Diffstat (limited to 'src/network/kernel/qhostinfo_p.h')
-rw-r--r-- | src/network/kernel/qhostinfo_p.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/src/network/kernel/qhostinfo_p.h b/src/network/kernel/qhostinfo_p.h index cc34d575b2..b10b765148 100644 --- a/src/network/kernel/qhostinfo_p.h +++ b/src/network/kernel/qhostinfo_p.h @@ -118,7 +118,6 @@ class QHostInfoAgent { public: static QHostInfo fromName(const QString &hostName); -private: static QHostInfo lookup(const QString &hostName); static QHostInfo reverseLookup(const QHostAddress &address); }; |