title: Using a Proxy with RestClient in a gem
body: <p>I am using the gem <code>nba_stats</code>, which queries nba.com's stats api. But I need to use a proxy with it and the gem doesn't offer that capability.</p>
  
  <p>Looking through the gem's code, I <a href="https://github.com/dagrz/nba_stats/blob/d6fe6cf81f74a2ce7a054aeec5e9db59a6ec42aa/lib/nba_stats/client.rb#L115" rel="nofollow noreferrer">see</a></p>
  
  <pre><code>@resource ||= RestClient::Resource.new(endpoint)
  </code></pre>
  
  <p>Can I just set <code>RestClient.proxy</code> and the gem will use the proxy? </p>
  
  <p>I tried</p>
  
  <pre><code>RestClient.proxy = "http://123@proxy.crawlera.com:8010"
  play_by_play = client.play_by_play('0021301230')
  </code></pre>
  
  <p>but I get an error</p>
  
  <pre><code>URI::InvalidURIError: bad URI(is not URI?): http://123@proxy.crawlera.com:8010
  </code></pre>
  
  <p>I also tried this, with and without the ':', and got the same error.</p>
  
  <pre><code>uri = URI.parse("http://proxy.crawlera.com")
  uri.port = 8010
  uri.user = "83a17a4219d543ef8800965d4293ac5d:"
  RestClient.proxy = uri
  client = NbaStats::Client.new
  play_by_play = client.play_by_play('0021301230')
  </code></pre>