{
  "schemaVersion": "0.11.0",
  "canonical": "https://www.pystone.net/notes/devops-proxy-configuration/",
  "atlas": "https://www.pystone.net/?node=devops-proxy-configuration#knowledge-atlas",
  "markdown": "https://www.pystone.net/notes/devops-proxy-configuration.md",
  "context": "https://www.pystone.net/notes/devops-proxy-configuration.context.json",
  "knowledgeVersion": "224c990773de.5fa8af6e39fa",
  "build": {
    "siteCommit": "224c990773de166d23a886306577dd90379529ce",
    "notesCommit": "5fa8af6e39fa3891d1b9b4832bfa6c4e0ecaaf0a",
    "builtAt": "1970-01-01T00:00:00.000Z",
    "version": "224c990773de.5fa8af6e39fa"
  },
  "id": "note:devops-proxy-configuration",
  "slug": "devops-proxy-configuration",
  "title": "【DevOps】代理配置方案",
  "type": "note",
  "visibility": "public",
  "idStability": "rename-stable",
  "author": {
    "name": "Perrin Yong",
    "profile": "https://www.pystone.net/profile/"
  },
  "publisher": {
    "name": "Perrin Yong",
    "profile": "https://www.pystone.net/profile/"
  },
  "aliases": [],
  "summary": "【DevOps】代理配置方案",
  "contentRole": "unspecified",
  "isMoc": false,
  "mocRecognition": "none",
  "generated": false,
  "attribution": "unspecified",
  "domain": "10-计算机、信息技术与工程",
  "tags": [],
  "mocs": [],
  "contentHash": "b831fb4b07d2bdb21ce9a587a4fbae3479254617bb4faf8507999d7b02e4a047",
  "assets": [
    {
      "reference": "assets/%E3%80%90DevOps%E3%80%91%E4%BB%A3%E7%90%86%E9%85%8D%E7%BD%AE%E6%96%B9%E6%A1%88__Image.png",
      "url": "/media/1b26d401b66b42949801.png",
      "mediaType": "image/png",
      "contentHash": "1b26d401b66b42949801ec1f7a200070e25888ecd8abef2eec4bb63c44961676",
      "byteLength": 286530,
      "width": 803,
      "height": 860
    },
    {
      "reference": "assets/%E3%80%90DevOps%E3%80%91%E4%BB%A3%E7%90%86%E9%85%8D%E7%BD%AE%E6%96%B9%E6%A1%88__Image_1.png",
      "url": "/media/9a8a50f58a9d1706ccd1.png",
      "mediaType": "image/png",
      "contentHash": "9a8a50f58a9d1706ccd1220904272815344c52c68a210b819537fbe41671c283",
      "byteLength": 4350,
      "width": 605,
      "height": 71
    }
  ],
  "headings": [
    {
      "depth": 1,
      "text": "【DevOps】代理配置方案",
      "anchor": "devops代理配置方案",
      "citation": "https://www.pystone.net/notes/devops-proxy-configuration/#devops%E4%BB%A3%E7%90%86%E9%85%8D%E7%BD%AE%E6%96%B9%E6%A1%88"
    },
    {
      "depth": 2,
      "text": "配置代理的本质",
      "anchor": "配置代理的本质",
      "citation": "https://www.pystone.net/notes/devops-proxy-configuration/#%E9%85%8D%E7%BD%AE%E4%BB%A3%E7%90%86%E7%9A%84%E6%9C%AC%E8%B4%A8"
    },
    {
      "depth": 2,
      "text": "代理客户端与手动配置",
      "anchor": "代理客户端与手动配置",
      "citation": "https://www.pystone.net/notes/devops-proxy-configuration/#%E4%BB%A3%E7%90%86%E5%AE%A2%E6%88%B7%E7%AB%AF%E4%B8%8E%E6%89%8B%E5%8A%A8%E9%85%8D%E7%BD%AE"
    },
    {
      "depth": 2,
      "text": "终端配置代理",
      "anchor": "终端配置代理",
      "citation": "https://www.pystone.net/notes/devops-proxy-configuration/#%E7%BB%88%E7%AB%AF%E9%85%8D%E7%BD%AE%E4%BB%A3%E7%90%86"
    },
    {
      "depth": 2,
      "text": "Git配置代理",
      "anchor": "git配置代理",
      "citation": "https://www.pystone.net/notes/devops-proxy-configuration/#git%E9%85%8D%E7%BD%AE%E4%BB%A3%E7%90%86"
    },
    {
      "depth": 2,
      "text": "命令行配置代理",
      "anchor": "命令行配置代理",
      "citation": "https://www.pystone.net/notes/devops-proxy-configuration/#%E5%91%BD%E4%BB%A4%E8%A1%8C%E9%85%8D%E7%BD%AE%E4%BB%A3%E7%90%86"
    },
    {
      "depth": 3,
      "text": "一键开启或关闭代理",
      "anchor": "一键开启或关闭代理",
      "citation": "https://www.pystone.net/notes/devops-proxy-configuration/#%E4%B8%80%E9%94%AE%E5%BC%80%E5%90%AF%E6%88%96%E5%85%B3%E9%97%AD%E4%BB%A3%E7%90%86"
    },
    {
      "depth": 2,
      "text": "代码行数统计",
      "anchor": "代码行数统计",
      "citation": "https://www.pystone.net/notes/devops-proxy-configuration/#%E4%BB%A3%E7%A0%81%E8%A1%8C%E6%95%B0%E7%BB%9F%E8%AE%A1"
    }
  ],
  "claims": [],
  "outgoing": [],
  "incoming": [
    {
      "id": "note:software-engineering-and-quality",
      "title": "软件工程与质量保障",
      "url": "https://www.pystone.net/notes/software-engineering-and-quality/",
      "atlas": "https://www.pystone.net/?node=software-engineering-and-quality#knowledge-atlas",
      "label": "软件工程与质量保障",
      "origin": "explicit",
      "humanReviewed": true,
      "context": "CI-CD与质量保障/CI-CD工具链中的“【DevOps】代理配置方案”导航项",
      "citation": "https://www.pystone.net/notes/software-engineering-and-quality/#ci-cd%E4%B8%8E%E8%B4%A8%E9%87%8F%E4%BF%9D%E9%9A%9Cci-cd%E5%B7%A5%E5%85%B7%E9%93%BE"
    }
  ],
  "contentMarkdown": "# 【DevOps】代理配置方案\n\n﻿# 【DevOps】代理配置方案\n\n> 创建时间：2021/9/29 15:23\n\n* 配置代理的本质\n  * 代理客户端与手动配置\n  * 终端配置代理\n  * Git配置代理\n  * 命令行配置代理\n    * 一键开启或关闭代理\n  * 代码行数统计\n\n## 配置代理的本质\n\n本质是启动一个代理服务程序，将网络请求通过 IP:Port 发送给代理服务程序，代理服务程序再进行信息的转发。\n\n## 代理客户端与手动配置\n\nV2RAY等客户端可以自动配置代理。\n配置的效果与在操作系统的网络设置当中手动配置一样。\n\n![](assets/%E3%80%90DevOps%E3%80%91%E4%BB%A3%E7%90%86%E9%85%8D%E7%BD%AE%E6%96%B9%E6%A1%88__Image.png)\n\n## 终端配置代理\n\nexport https_proxy=http://127.0.0.1:7890\nexport http_proxy=http://127.0.0.1:7890\nexport all_proxy=socks5://127.0.0.1:789\n\n## Git配置代理\n\nhttps://zhuanlan.zhihu.com/p/390620901\nhttps://imciel.com/2016/06/28/git-proxy/\n\nv2ray软件上可以看到http或socks5协议分别使用的端口号，url的协议和端口要对应好。\n\n![](assets/%E3%80%90DevOps%E3%80%91%E4%BB%A3%E7%90%86%E9%85%8D%E7%BD%AE%E6%96%B9%E6%A1%88__Image_1.png)\n\n```csharp\nstring a = &quot;test&quot;;\nstring tmp = &quot;est&quot;;\nstring b = &quot;t&quot; + tmp;\nConsole.WriteLine(string .ReferenceEquals(str1, str2));\n\n```\n\n## 命令行配置代理\n\ngit, curl 等命令都可以临时配置代理，一般是加这样的参数：\n\n```csharp\nstring a = &quot;test&quot;;\nstring tmp = &quot;est&quot;;\nstring b = &quot;t&quot; + tmp;\nConsole.WriteLine(string .ReferenceEquals(str1, str2));\n\n```\n\n### 一键开启或关闭代理\n\n```csharp\nstring a = &quot;test&quot;;\nstring tmp = &quot;est&quot;;\nstring b = &quot;t&quot; + tmp;\nConsole.WriteLine(string .ReferenceEquals(str1, str2));\n\n```\n```csharp\nstring a = &quot;test&quot;;\nstring tmp = &quot;est&quot;;\nstring b = &quot;t&quot; + tmp;\nConsole.WriteLine(string .ReferenceEquals(str1, str2));\n\n```\n\n## 代码行数统计\n\nhttps://www.jianshu.com/p/1a08c3dcbe42\n"
}
