Vagrant::Util::Downloader class support for proxy

10 views
Skip to first unread message

Budh Ram

unread,
Oct 18, 2016, 3:12:11 AM10/18/16
to Vagrant
Hi Folks,

I have a use case where I am using Vagrant native downloader to download a file from url to some location locally in developing a plugin [1].

Now, I have requirement where my workstation doesn't have any internet access except to proxy server.

As I remember, curl support proxy as answered here [2] :

curl http://www.example.com --proxy http://125.119.175.48:8909

Can I achieve similar thing with `Vagrant::Util::Downloader` utility class?




Thanks
Budh Ram

Alvaro Miranda Aguilera

unread,
Oct 18, 2016, 4:12:25 AM10/18/16
to vagra...@googlegroups.com
the tools used in vagrant use the standard variables,

so you can test in the following way:

 set the variables outside vagrant


the variables are


http_proxy=http://user:pass@server:port
https_proxy=http://user:pass@server:port
HTTP_PROXY=http://user:pass@server:port
HTTPS_PROXY=http://user:pass@server:port

if you use windows/cmd

set variable=content

for bash/linux/osx

export variable=content




--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/c0eff2cc-624d-4fe4-b115-b10387da2adb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Budh Ram

unread,
Oct 24, 2016, 6:13:41 AM10/24/16
to vagra...@googlegroups.com
On Tue, Oct 18, 2016 at 1:42 PM, Alvaro Miranda Aguilera <kik...@gmail.com> wrote:
the tools used in vagrant use the standard variables,

so you can test in the following way:

 set the variables outside vagrant


the variables are


http_proxy=http://user:pass@server:port
https_proxy=http://user:pass@server:port
HTTP_PROXY=http://user:pass@server:port
HTTPS_PROXY=http://user:pass@server:port

if you use windows/cmd

set variable=content

for bash/linux/osx

export variable=content


Thanks for the reply. But I think is for general use through Vagrant command line.

I am talking here about the code perspective of this class [1]

How can I use this class to download url using Vagrant::Util::Downloader class? I believe it uses curl [2] to download.

But couldn't find the way to use proxy details.


 

For more options, visit https://groups.google.com/d/optout.



--
Regards,
Budh Ram Gurung
Reply all
Reply to author
Forward
0 new messages