跟进How to configure docker container proxy?
我在将本地主机代理传递到docker容器时遇到了问题:
$ curl --proxy socks5://localhost:18888 https://goolge.ca
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
docker run -ti -p 18888:18888 ...
# within docker
$ curl --proxy socks5://localhost:18888 https://goolge.ca
curl: (7) Failed to connect to localhost port 18888: Connection refused
$ curl --proxy https://localhost:18888 https://goolge.ca
curl: (7) Failed to connect to localhost port 18888: Connection refused
$ curl --proxy http://localhost:18888 https://goolge.ca
curl: (7) Failed to connect to localhost port 18888: Connection refused
$ curl --proxy socks5://0.0.0.0:18888 https://goolge.ca
curl: (7) Failed to connect to 0.0.0.0 port 18888: Connection refused--net=host,但结果是一样的.我错过了什么?
发布于 2021-01-21 16:24:58
如果在docker容器的bash中运行这些命令,则应该使用
#within docker
$ curl --proxy socks5://0.0.0.0:18888 https://goolge.cahttps://stackoverflow.com/questions/65831539
复制相似问题