I wanted to explore different options for having a script run with asynchronous request to a remote http server. With PHP this can be done with multicurl handles, but limiting the concurrent requests was problematic. It also seemed slow.

After a bit of research, I chose Ruby as i found the Typhoeus library/gem, it just meant I had to learn some Ruby.

Typhoeus is just a libcurl library, but also comes with Hydra, a method for stacking requests concurrently.

I also have a wireguard VPN setup, which comes along with optional socks5 proxies to reroute traffic as desired.

The script loops through the list of proxies and queries a remote server for the requesting IP address. And with some additional information about the timing of the requests.

  seconds         proxy                                       ip
  0.922           socks5://us9-wg.socks5.mullvad.net:1080
  1.436           socks5://ch2-wg.socks5.mullvad.net:1080
  1.531           socks5://cz1-wg.socks5.mullvad.net:1080
  1.583           socks5://se1-wg.socks5.mullvad.net:1080
  1.592           socks5://bg4-wg.socks5.mullvad.net:1080
  1.596 seconds total
  0.266 per request [6 requests]

Whilst running requests through a proxy does increase the time taken, the ability to have 400+ remote ip addresses available is worth the decrease in performance. I could use this to test the performance of my webserver, for instance.

And I got to use a new programming language.

Full script as follows: