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

Failed to listen on IPv6 #1

Open
leesei opened this issue Jul 5, 2024 · 5 comments
Open

Failed to listen on IPv6 #1

leesei opened this issue Jul 5, 2024 · 5 comments
Labels
bug Something isn't working enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@leesei
Copy link

leesei commented Jul 5, 2024

It may be on me, but I failed to use oidc-cli because it tries to bind IPv6 address.

$ oidc-cli create public keycloak_pub --issuer http://192.168.1.9:8080/realms/my-realm --client-id my-app
10:19:43 [ERROR] Address not available (os error 99)

I can use it after changing this line:

-       let addr = SocketAddr::new(Ipv6Addr::LOCALHOST.into(), port);
+       let addr = SocketAddr::new(Ipv4Addr::LOCALHOST.into(), port);

It is sad to see that IPv6 still have such paper cuts nowadays. I've enabled IPv6 at least 😝.
Is there any particular reason for using IPv6?
BTW, I'm using Arch.

@ctron
Copy link
Owner

ctron commented Jul 5, 2024

Interesting, and thanks for reporting.

I would love to have some kind of "just bind to something" :)

I never had any issues with IPv6 in the past, that was the main motivation. I guess having some way to auto-detect this (and fall back) or some -4 switch would make sense.

Any chance you can come up with a PR for this?

@ctron ctron added bug Something isn't working enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Jul 5, 2024
@leesei
Copy link
Author

leesei commented Jul 6, 2024

I also hoped IPv6 to "just work".

I can submit a PR for binding to IPv4 address.
But adding CLI parameter in Rust program is out of my capability at the moment 😄.

@ctron ctron closed this as completed in 11ca9f7 Jul 8, 2024
@leesei
Copy link
Author

leesei commented Jul 23, 2024

Sorry for reviving this issue, I suppose https://github.com/ctron/oidc-cli/blob/main/src/server.rs#L57 is meant to be (Ipv4Addr::LOCALHOST, port)?

@ctron
Copy link
Owner

ctron commented Jul 23, 2024

Sorry for reviving this issue, I suppose https://github.com/ctron/oidc-cli/blob/main/src/server.rs#L57 is meant to be (Ipv4Addr::LOCALHOST, port)?

🤦 … yes!

@ctron ctron reopened this Jul 23, 2024
@ctron
Copy link
Owner

ctron commented Jul 23, 2024

There's a new release (0.3.3) which should really fix the issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants