dselp3944 2014-07-26 11:33
浏览 34
已采纳

让git / go获得使用代理域

Before you read: I don't want to do malicious things, but setup a tool chain to overcome the flaws of go get.

I want to have a setup that allows the following:

  • I have a set of domains, like github.com, bitbucket.org, etc.
  • If git clones/pushes/pulls with a remote repository from any of the domains the domains are resolved to an IP address of my proxy
  • For any other program the domains resolve to real IP addresses
  • My proxy should be a program that hosts/caches repositories and clones them from the real target if they are not in the cache. This program should be written in Go

The git commands must be used as normal. Git configuration may be changed.

The idea is to have all development computers of a team configured this way, so that any external repository is in fact a clone on the proxy. That clone could be managed in a centralized way (special changes, merges will upstream etc.) without affecting the import paths.

How would I setup the DNS faking? How must the proxy be built in order to properly work with git?

  • 写回答

1条回答 默认 最新

  • douji2520 2014-07-26 13:39
    关注

    Starting with git 1.8.5, you can setup directly in git global settings proxy for specific urls:

    [http "http://github.com" ]
      proxy = http://my.proxy:8080
    [https "https://github.com" ]
      proxy = http://my.proxy:8080
    

    See "Only use a proxy for certain git urls/domains?"

    That helps when you want to use a proxy only for certain urls.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?