简体   繁体   中英

How to use proxy in terminal?

If I unset http_proxy, curl works just fine. But if I

export http_proxy= “127.0.0.1:10010”

The port is of socks5 and is found in the network setting of my MacBook. Then whatever address I curl, the following error occurs.

curl: (52) Empty reply from server.

Also, I'm confused about how it works.

You need to tell it that this is a SOCKS5 proxy, rather than a plain HTTP proxy:

export http_proxy="socks5://127.0.0.1:10010"
#                  ^^^^^^^^^

See the "proxy protocol prefixes" section of the curl man page .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM