cURL coursier 使用代理下载文件

在ubuntu12.04中使用crul下载coursier(以安装scala以使用Chisel)时出现问题,无法下载。

经过搜索可以使用代理来下载,经过试用之后成功。

curl -x "http://user:pwd@127.0.0.1:1234" "http://httpbin.org/ip"

or

curl --proxy "http://user:pwd@127.0.0.1:1234" "http://httpbin.org/ip"

我是用的是Proxy是Socks5的。

 curl -x "socks5://@127.0.0.1:12306" -fLo cs https://git.io/coursier-cli-"$(uname | tr LD ld)"

其中12306部分要换成你实际的端口名字

 

而 coursier中也要配置使用代理:

使用 -J-Dhttps.proxyHost 和 -J-Dhttps.proxyPort 标记:

./cs install cs -J-Dhttps.proxyHost=127.0.0.1 -J-Dhttps.proxyPort=10086

 



 

posted @ 2022-01-26 12:03  北风Z  阅读(345)  评论(0编辑  收藏  举报