关于代理设置

git无法正常更新,大家请执行以下命令:

git config --global http.proxy http://10.10.XX.XXXX:8080

Visual Studio Code

格式:npm config set proxy http://用户名:密码@代理服务器IP:端口

npm config set registry https://registry.npm.taobao.org

npm config set proxy http://你的用户名:你的密码@你的代理服务器IP:你的端口

npm i certificate

 java gradle.properties代理设置

systemProp.http.proxyHost=代理服务器IP
systemProp.http.proxyPort=端口
systemProp.http.proxyUser=用户名
systemProp.http.proxyPassword=密码
systemProp.http.nonProxyHosts=localhost|10.*.*.*|192.168.*.*

systemProp.https.proxyHost=代理服务器IP
systemProp.https.proxyPort=8080
systemProp.https.nonProxyHosts=localhost|10.*.*.*|192.168.*.*
systemProp.https.proxyUser=userid
systemProp.https.proxyPassword=userPassword

java在程序内部实通过代理访问网络资源
private void setProxy(StreamingConfigure streamingConfigure) {

System.setProperty("http.proxySet", "true");
System.setProperty("http.proxyHost", 你的代理服务器IP);
System.setProperty("http.proxyPort", 端口);
System.setProperty("http.proxyUserName", 代理用户名);
System.setProperty("http.proxyPassword", 代理密码);

// https proxy
System.setProperty("https.proxyHost", 你的代理服务器IP);
System.setProperty("https.proxyPort", 端口);
System.setProperty("https.proxyUserName", 代理用户名);
System.setProperty("https.proxyPassword", 代理密码);

// socks proxy
// System.getProperties().put("socksProxySet","true");
// System.getProperties().put("socksProxyHost",你的代理服务器IP);
// System.getProperties().put("socksProxyPort","1080");

System.setProperty("socksProxySet","true");
System.setProperty("socksProxyHost",你的代理服务器IP);
System.setProperty("socksProxyPort","1080");
}

猜你喜欢

转载自www.cnblogs.com/wzihan/p/12918571.html