mwmitchell/rsolr — pull request #62 by cbeattie-talemetry (2013-04-15 15:07:51+00:00)
Title: Fixed connection to Solr through proxy

I discovered an issue where when you specify a proxy via RSolr#connect the URL used to connect to the Solr server is changed to the proxy host/port.

Consider the following:
```ruby
solr = RSolr.connect({
:url => 'http://localhost:10000/solr/mycollection',
:proxy => 'http://localhost:8080'
})
```

Calling solr#add would result in an HTTP request similar to:
http://localhost:8080/solr/mycollection/update...

The culprit seems to be the base_uri method in the client.rb file. I don't know why, but when a proxy is specified it uses the proxy host & port instead of the given Solr host & port. This seems incorrect to me. In the http method in connection.rb it correctly uses a proxy shim thus resulting in an HTTP CONNECT through the proxy (which is exactly what we want).