Closed kidlj closed 5 years ago
Sorry, found the 'http_proxy' setting in the remote Docker host user profile.
$ env
NO_PROXY=localhost,127.0.0.1,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
HTTPS_PROXY=http://127.0.0.1:8118
HTTP_PROXY=http://127.0.0.1:8118
Closed.
Nope. Even I removed the remote Docker host 'HTTP_PROXY' settings, and set the VSCode remote proxy settings like following, it still connects to 127.0.0.1:8118
. I'm still confused where it reads the proxy setting from.
VSCode Remote settings:
{
"terminal.integrated.shell.linux": "/bin/bash",
"go.gopath": "/go",
"go.inferGopath": true,
"go.useLanguageServer": true,
"http.proxy": "http://10.20.9.10:8118"
}
Installing 1 tool at /go/bin
gocode
Installing github.com/mdempsky/gocode FAILED
1 tools failed to install.
gocode:
Error: Command failed: /usr/local/go/bin/go get -u -v github.com/mdempsky/gocode
github.com/mdempsky/gocode (download)
# cd /go/src/github.com/mdempsky/gocode; git pull --ff-only
fatal: unable to access 'https://github.com/mdempsky/gocode/': Failed to connect to 127.0.0.1 port 8118: Connection refused
package github.com/mdempsky/gocode: exit status 1
github.com/mdempsky/gocode (download)
# cd /go/src/github.com/mdempsky/gocode; git pull --ff-only
fatal: unable to access 'https://github.com/mdempsky/gocode/': Failed to connect to 127.0.0.1 port 8118: Connection refused
package github.com/mdempsky/gocode: exit status 1
Got it. When VSCode remote extension build the remote container, it will copy local user's .gitconfig to remote container.
Here's the output:
Run: docker cp /Users/mellon/.gitconfig 101f058bd175d53cc243f51a2b90d7be1a66d35e0750d3d2f68a2a0acf7d3c2a:/home/centos/.gitconfig --follow-link
Since I have proxy settings in my local macOS .gitconfig, it retains in remote container, that's why git clone failed.
I'm running VSCode and Go extension running in a remote Docker container, it works great. However, when issuing the "Go: Install/Update Tools" command, it seems to connect to an unspecified proxy server, which fails.
Here's the Go extension output:
I'm kind of familiar with the address
127.0.0.1:8118
, which is a v2ray proxy server running on my macOS localhost. The problem is that I'm not specifying anyHTTP_PROXY
,http_proxy
or VSCodehttp.proxy
settings in anywhere, like in .bashrc, .bash_profile, /etc/profile, or in VSCode user/remote container/workspace config files.Here is the
env
output from macOS:And the
env
output from remote docker:The VSCode user settings:
VSCode remote container settings:
VSCode workspace settings:
I should also mention that the remote Docker engine that VSCode running on has a proxy setting like this:
, where
master
is another virtual machine node, with IP address of10.20.9.10
, but even when I turn off this Docker proxy settings, VSCode Go extension still connects to127.0.0.1:8118
, so I don't know if they are related.P.S. If I issue
go get
on the remote Docker container manually, it works.Thanks for any help.