title: How to check if a proxy is connectable in Ruby?
body: <p>I have a list of public proxies that I have scraped from the web, but many of them are not actually connectable. I would like to filter this list using Ruby.</p>
  
  <p>How would I craft a function such that it returns true if I can successfully connect to the proxy and false otherwise?</p>
  
  <p>Here's the general idea:</p>
  
  <pre><code>def connectable?(proxy)
    ip, port = proxy.split(':')
    return true if connect(ip, port) == success
    false
  end
  </code></pre>