Tanny
Tanny

Reputation: 3

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.

Upvotes: 0

Views: 5302

Answers (1)

Gordon Davisson
Gordon Davisson

Reputation: 125708

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.

Upvotes: 2

Related Questions