[s3-dev] using aws-s3 via a proxy (Net::HTTP::Proxy)

Simon Horne simon at soulware.co.uk
Sun May 6 11:05:19 EDT 2007


Hi,

cool -
just tried this out and it looks like it works fine.
One suggestion - could the proxy user and password be made optional,  
just for convenience if not needed?

Thanks,

Simon


On 5 May 2007, at 03:21, Marcel Molina Jr. wrote:

> On Thu, Apr 05, 2007 at 03:20:27PM +0000, Marcel Molina Jr. wrote:
>> On Thu, Apr 05, 2007 at 05:58:46AM -0500, Simon Horne wrote:
>>> it does not appear to be possible to access S3 with aws-s3 via a  
>>> proxy.
>>> I've had a look in connection.rb and there is a direct call to
>>> Net::HTTP.new().
>>> It looks like it would be simple enough to use Net::HTTP::Proxy 
>>> ().new()
>>> and to use options to specify the proxy
>>> settings.
>>> If no :proxy_host is specified then it will safely default to no  
>>> proxy.
>>>
>>> Would this be feasible?
>>>
>>> See below for a patch (from 0.3.0 release) -
>>>
>>> 82c82
>>> <           @http             = Net::HTTP.new(options[:server],
>>> options[:port])
>>> ---
>>>>           @http             = Net::HTTP::Proxy(options 
>>>> [:proxy_addr],
>>> options[:proxy_port], options[:proxy_user],
>>> options[:proxy_pass]).new(options[:server], options[:port])
>>> 211c211
>>> <             [:access_key_id, :secret_access_key, :server, :port,
>>> :use_ssl, :persistent]
>>> ---
>>>>             [:access_key_id, :secret_access_key, :server, :port,
>>> :use_ssl, :persistent, :proxy_addr, :proxy_port,
>>> :proxy_user, :proxy_pass]
>>
>> Hey Simon, that looks pretty reasonable. I'll shoe horn it in.  
>> Thanks.
>
> Hey Simon, et al. I've gotten around to adding an initial version  
> of proxy
> support.
>
> Beta gem is available here:
> http://amazon.rubyforge.org/beta/aws-s3-0.3.1178330006.gem
>
> I've attached a diff for those interested in the details.
>
> I've implemented tests for the wiring, but have not set up any  
> remote tests
> for it, so I haven't verified it actually hitting the s3 servers.
>
> For those who have a need for this, please give it a whirl and let  
> me know if
> you have any problems with it.
>
> Documentation is included for those wondering how to actually use  
> the new
> :proxy option :)
>
> marcel
> -- 
> Marcel Molina Jr. <marcel at vernix.org>
> <connection-through-proxy-for-aws-s3.diff>
> _______________________________________________
> amazon-s3-dev mailing list
> amazon-s3-dev at rubyforge.org
> http://rubyforge.org/mailman/listinfo/amazon-s3-dev



More information about the amazon-s3-dev mailing list