Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

socks: print IPv6 address in square brackets #11483

Closed

Conversation

Chilledheart
Copy link

IPv6 address with port number should be printed with square brackets.

The [] style as expressed in [RFC3986] SHOULD be
employed, and is the default unless otherwise specified.

refer: https://www.rfc-editor.org/rfc/rfc5952#section-6

with command line: curl -v --proxy socks5://localhost:1083 -I http://localhost:12345

previous:

* SOCKS5 connect to IPv6 ::1:12345 (locally resolved)
* SOCKS5 request granted.

current:

* SOCKS5 connect to IPv6 [::1]:12345 (locally resolved)
* SOCKS5 request granted.

IPv6 address with port number should be printed with square brackets.

> The [] style as expressed in [RFC3986] SHOULD be
> employed, and is the default unless otherwise specified.

refer: https://www.rfc-editor.org/rfc/rfc5952#section-6
bagder added a commit that referenced this pull request Jul 20, 2023
@bagder
Copy link
Member

bagder commented Jul 20, 2023

It seems unnecessary to add that much new (ifdef'ed) code when we already have most of the logic in place. I propose #11484 as an alternative fix for the same result.

@Chilledheart
Copy link
Author

Your pr is better(more consistent with other part which prints IPv6 address with brackets as well). Feel free to close this one if yours gets merged.

@bagder bagder closed this in 95301e4 Jul 20, 2023
@Chilledheart Chilledheart deleted the socks_print_ipv6_address branch July 21, 2023 01:58
ptitSeb pushed a commit to wasix-org/curl that referenced this pull request Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

2 participants