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

Closed
leesei opened this issue Jul 5, 2024 · 9 comments
Closed

Failed to listen on IPv6 #1

leesei opened this issue Jul 5, 2024 · 9 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 :)

@MartinLoeper
Copy link

Hi @ctron, could you please reconsider adding a -4 flag to bind the application to an ipv4 socket?

The issue in my case is: I am using devcontainers in vscode and the port forwarding is currently broken (see: microsoft/vscode-remote-release#7029). Thus, I would like to force using the ipv4 address.

@ctron
Copy link
Owner

ctron commented Dec 5, 2024

Hi @ctron, could you please reconsider adding a -4 flag to bind the application to an ipv4 socket?

Sounds like a good idea.

@ctron ctron closed this as completed in dc57267 Dec 5, 2024
@ctron
Copy link
Owner

ctron commented Dec 5, 2024

I released this as 0.4.0. Maybe you can check and see if that fixes your case too.

@MartinLoeper
Copy link

Awesome! I just tested it and it works. Thanks so much @ctron!!

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

3 participants