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

Option to enable/disable IPv6 #1169

Open
orlandothoeny opened this issue Mar 11, 2024 · 6 comments
Open

Option to enable/disable IPv6 #1169

orlandothoeny opened this issue Mar 11, 2024 · 6 comments
Assignees

Comments

@orlandothoeny
Copy link

Description
We cannot use the library since version 3.6.1, because of #1145.

We use https://github.com/cloudamqp/amqproxy which only listens on IPv4. Our application connects to this proxy via localhost, which has the default ::1 localhost ip6-localhost ip6-loopback entry in the server's /etc/hosts file.

Possible fixes:

  • Either make it that IPv6 support must be explicitly enabled or add an option that allows disabling IPv6
  • Have some sort of check that validates that IPv6 is actually working, not sure though if that would be too expensive performance-wise

Example
We get the following error:

In SocketIO.php line 82:
                                                        
  [PhpAmqpLib\Exception\AMQPIOException (111)]          
  Error Connecting to server (111): Connection refused
@lukebakken lukebakken self-assigned this Mar 11, 2024
@lukebakken
Copy link
Collaborator

Hello, thanks for using this library.

You should fix your /etc/hosts file. It is quite unusual for localhost to be an ipv6 address.

We would also accept a PR that addresses this issue without breaking existing behavior.

@ramunasd
Copy link
Member

Just use 127.0.0.1 for connection if proxy is listening on local loopback.

@orlandothoeny
Copy link
Author

We're using the default /etc/hosts of Ubuntu.

Yes, changing to an IP (127.0.0.1) would probably be the easiest fix.

@lukebakken
Copy link
Collaborator

Hmm, I'm surprised the ipv6 address is picked up first.

$ docker run --pull always --tty --interactive ubuntu:latest
latest: Pulling from library/ubuntu
bccd10f490ab: Already exists
Digest: sha256:77906da86b60585ce12215807090eb327e7386c8fafb5402369e421f44eff17e
Status: Downloaded newer image for ubuntu:latest
root@0e7320e07973:/# cat /etc/hosts
127.0.0.1       localhost
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.17.0.2      0e7320e07973

@orlandothoeny
Copy link
Author

orlandothoeny commented Mar 11, 2024

Yes it's strange, the 127.0.0.1 localhost record is also the first one on our servers:

cat /etc/hosts
127.0.0.1	localhost
127.0.1.1	my-ubuntu-user

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

@orlandothoeny
Copy link
Author

orlandothoeny commented Mar 11, 2024

Oh no, wait a second..
That was my local one. There localhost doesn't even point to ::1.

Seems like this changed in some Ubuntu version or is different on the Ubuntu Server version.
That's the actual one from the server:

127.0.0.1	localhost

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants