How do I configure go command to use a proxy?

后端 未结 7 1690
鱼传尺愫
鱼传尺愫 2020-12-02 05:34

I want to run go install to install the tour, but I can\'t find the option to use a proxy for internet access. I don\'t need this just for the tour but for deve

7条回答
  •  旧时难觅i
    2020-12-02 05:50

    You may want check https://github.com/hmgle/graftcp,

    $ graftcp-local/graftcp-local -h
    Usage of graftcp-local/graftcp-local:
      -config string
            Path to the configuration file
      -listen string
            Listen address (default ":2233")
      -logfile string
            Write logs to file
      -loglevel value
            Log level (0-6) (default 1)
      -pipepath string
            Pipe path for graftcp to send address info (default "/tmp/graftcplocal.fifo")
      -service string
            Control the system service: ["start" "stop" "restart" "install" "uninstall"]
      -socks5 string
            SOCKS5 address (default "127.0.0.1:1080")
      -syslog
            Send logs to the local system logger (Eventlog on Windows, syslog on Unix)
    

    If you already have shadowsocks listening on 1080, then you don't need provide any paramaters, just run graftcp-local, to proxy go get

    $ ./graftcp go get -v golang.org/x/net/proxy
    

提交回复
热议问题