Paho's Python client has a documented proxy_set method. Configure that client before connecting to the MQTT broker:

client.proxy_set(proxy_type=socks.SOCKS5,
                 proxy_addr='203.0.113.10',
                 proxy_port=1080)

This assumes a compatible Paho client and its required SOCKS support are already available. The endpoint is illustrative. For a publicly reachable broker on a permitted public-proxy route, the SOCKS5 proxy list offers host and port candidates; confirm that the node permits the actual broker destination. The method documents supported proxy types and passes proxying through PySocks.

The broker still has its own hostname, port, TLS requirements, and MQTT authentication. A proxy account does not become the username sent to the broker. Likewise, setting broker credentials does not authenticate the proxy hop.

Check the connection transport and the proxy's allowed destinations when connection setup fails. A proxy carrying web browsing does not automatically permit a broker's TCP port.

Keep the MQTT network loop running as required by the Paho API after connection setup. Establishing the proxy route is one step; it does not drive MQTT keepalives, callbacks, and acknowledgements on its own.

Аффингæй хæстæг статьялтæ