curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Supporting socks proxy via unix sockets

From: Dan Fandrich via curl-users <curl-users_at_lists.haxx.se>
Date: Mon, 11 Apr 2022 17:16:53 -0700

On Mon, Apr 11, 2022 at 05:17:20PM -0400, Balakrishnan Balasubramanian via curl-users wrote:
> Following up for this feature. The current pull request works with below syntax
>
>     curl --proxy "socks5h://unix/path/to/socks.sock" "https://example.com"
>
>     curl --socks5-hostname "unix/path/to/socks.sock" "https://example.com"
>
> The '/path/to/socks.sock' is assumed as absolute path. If the hostname part of
> the url is 'unix' and the path part of the url is not empty, the proxy is
> assumed to be over unix domain socket.
>
> The other option for the syntax,
>
>     curl --proxy "socks5h://../path/to/socks.sock
>
> It could be a bit confusing as '..' usually refers to parent directory. Also
> should the path be absolute or relative? Please confirm which syntax you'd like
> to go with.

My preference is still for the file: style triple-slash syntax
socks5h:///path/to/socks.sock but it sounds like that won't work without
changes to the URL parser. Given that a normal socks path will never use the
path portion of the URL, it means the host part could be pretty flexible. So
much so that the host part could be completely ignored if a path of any sort
exists in the URL (I'm not suggesting we do that, though).

Dan
-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-users
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2022-04-12