Probably by modifying the source code of https://tinyproxy.github.io (it's a lightweight proxy, but modifying the source would be not a 5-minute thing...)
That's what I'd love to see. Have the ability to set a desired latency for specific domains and have it apply to all traffic on the network.