终端命令行;

设置代理:

export http_proxy=http://172.16.2.16:3199
export https_proxy=http://172.16.2.16:3199

取消代理设置:

unset http_proxy
unset https_proxy

演示:

book@ubuntu:~/pt1416/02-hellogolang/grpcTest/client$ go run client.go
2022/03/30 17:09:01 err where calling sayHello:rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing failed to do connect handshake, response: \"HTTP/1.1 403 Forbidden\\r\\nContent-Length: 333\\r\\nCache-Control: no-cache\\r\\nConnection: keep-alive\\r\\nContent-Type: text/html\\r\\nPragma: no-cache\\r\\n\\r\\n<!DOCTYPE html>\\n<html>\\n\\t<head> <title>COW Proxy</title> </head>\\n\\t<body>\\n\\t\\t<h1>[Error] Forbidden tunnel port</h1>\\n\\t\\t<p>HTTP Request <strong>CONNECT :9000</strong></p> <p>Please contact proxy admin.</p>\\n\\t\\t<hr />\\n\\t\\tGenerated by <i>COW 0.9.8</i> <br />\\n\\t\\tHost <i>it-cowproxy-master</i> <br />\\n\\t\\tWed Mar 30 17:09:01 2022\\n\\t</body>\\n</html>\\n\""
exit status 1
book@ubuntu:~/pt1416/02-hellogolang/grpcTest/client$ unset https_proxy
book@ubuntu:~/pt1416/02-hellogolang/grpcTest/client$ go run client.go
2022/03/30 17:09:54 err where calling sayHello:rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing failed to do connect handshake, response: \"HTTP/1.1 403 Forbidden\\r\\nContent-Length: 333\\r\\nCache-Control: no-cache\\r\\nConnection: keep-alive\\r\\nContent-Type: text/html\\r\\nPragma: no-cache\\r\\n\\r\\n<!DOCTYPE html>\\n<html>\\n\\t<head> <title>COW Proxy</title> </head>\\n\\t<body>\\n\\t\\t<h1>[Error] Forbidden tunnel port</h1>\\n\\t\\t<p>HTTP Request <strong>CONNECT :9000</strong></p> <p>Please contact proxy admin.</p>\\n\\t\\t<hr />\\n\\t\\tGenerated by <i>COW 0.9.8</i> <br />\\n\\t\\tHost <i>it-cowproxy-master</i> <br />\\n\\t\\tWed Mar 30 17:09:54 2022\\n\\t</body>\\n</html>\\n\""
exit status 1
book@ubuntu:~/pt1416/02-hellogolang/grpcTest/client$ unset http_proxy
book@ubuntu:~/pt1416/02-hellogolang/grpcTest/client$ go run client.go
2022/03/30 17:10:00 respond from Server :Hello from the server!
book@ubuntu:~/pt1416/02-hellogolang/grpcTest/client$

Ubuntu 代理设置与取消相关推荐

  1. 浏览器代理设置和取消代理

    网络能够正常访问,但是浏览器打不开,QQ 可以正常上网.可以 ping的通网络.浏览器没有出现报错情况下 第一种  判首先查看浏览器是否开启了代理, (如果是,就取消代理):操作步骤按照箭头点击鼠标 ...

  2. Ubuntu 代理上网设置

    一.Firefox代理上网 这个最简单了,依次点击 edit->preferences-> Advanced->network->settings 在里面填写代理服务器的IP, ...

  3. git设置和取消代理

    git设置和取消代理 转载于 git 设置和取消代理 - 削微寒 - 博客园 # 设置ss git config -global http.proxy 'socks5://127.0.0.1:1080 ...

  4. Ubuntu下Apache反向代理设置

    Apache可通过mod_proxy*.so系列模块很好的实现正向.反向代理功能,亦可通过反向代理实现负载均衡,本文将讲述基于Apache反向代理实现负载均衡的配置方法. 1.环境配置说明: 代理服务 ...

  5. GitHub 设置和取消代理,加速 git clone

    GitHub 设置和取消代理,加速 git clone git 设置代理: git config --global http.proxy http://127.0.0.1:1080 git 取消代理: ...

  6. ubuntu proxy(代理)设置全局

    ubuntu的代理设置好了之后,发现终端的代理没有起作用 可以直接在/etc/enviroment文件中直接加入代理信息: export https_proxy='https://proxy_ip:p ...

  7. vmware Ubuntu虚拟机设置代理

    1.虚拟机设置代理 打开Ubuntu的设置,并点击Network->Network Proxy选择Manual,并填写代理地址. 其中ip可以直接在主机上查看.要用VMware那个IP. 2.V ...

  8. git配置取消代理_git 设置和取消代理

    git 设置和取消代理 # 设置ss git config --global http.proxy 'socks5://127.0.0.1:1080' git config --global http ...

  9. ubuntu 虚拟机设置全局代理 windows 上网环境

    ubuntu 虚拟机设置全局代理 windows 上网环境 背景 准备工作 STEP 1:启用 windows 上代理的"允许来自局域网连接" STEP 2:设置虚拟机为桥接模式 ...

最新文章

  1. CentOS-7.2、7.5模板机制作
  2. OPNsense 18.7.X汉化包发布!
  3. mvc4站点支持.html
  4. 要学会Python爬虫都需要什么基础呢?
  5. java链表需要自己编写么_基于java的链表基础操作
  6. Android开发中activity切换动画的实现
  7. shell两个时间字符串插值_Shell 脚本速成
  8. 机器学习中的决策树算法
  9. Difference between natural join and inner join
  10. 3)Allegro PCB Router Tutorial自动布线入门
  11. MATLAB基本语法
  12. 谷歌开源 ClusterFuzz,自动化查找并修复 bug
  13. [工具使用]SqlMap
  14. 带你走进 ERNIE
  15. C/C++指向指针的指针、指向数组的指针以及存放指针的数组
  16. 为什么华为a1路由器网速变慢_凭什么网速就比别人快?华为路由 A1 畅享版体验...
  17. AE基础教程第一阶段——22旋转动画初体验
  18. springboot曦乐苹果园林管理系统的设计与实现100854
  19. Python爬虫实现抓取腾讯视频所有电影-源码【实战必学】
  20. android 游戏 实战打飞机游戏 菜单页面(1)

热门文章

  1. 【超详细】逻辑回归之kaggle糖尿病预测实战
  2. 买钢乐不锈钢5月19号日评:仓单资源有序释放,解市场缺货之急
  3. 試用Google翻譯為簡體中文
  4. 4. 云停车 (平台篇)
  5. Podman安装与运用
  6. 结构化思维-学习笔记
  7. HDU 2717(* bfs)
  8. 【日本 FFG福冈银行将利用区块链打造区域积分平台】GBCAX
  9. (实验文档和源码)一次从数据采集到实验分析的完整脑电情绪识别
  10. office online server实现文档的预览编辑