QNetworkProxy proxy(
    QNetworkProxy::Socks5Proxy,
    QStringLiteral("proxy.example.net"),
    1080);
udpSocket->setProxy(proxy);

Apply this to the application's existing QUdpSocket before bind or connect. The SOCKS server must implement UDP association; proxy capability flags and successful TCP browsing do not test that operation. For a permitted public UDP test, the SOCKS5 proxy list offers address candidates, but each candidate’s UDP association and target access must be verified separately.

OperationSOCKS5 UDP consideration documented by Qt
bindCan time out
Request nonzero local portDoes not guarantee that port will be used
Inspect resultRead localPort and localAddress for actual information

The relay adds a UDP path on which packet loss remains possible. Proxy account values use the object's user/password properties.

Changing the proxy cannot move a connected socket. Interpret localhost trials carefully too: Qt bypasses network proxies for its documented localhost addresses in connectToHost, bind or listen.

འབྲེལ་བའི་རྩོམ་ཡིག