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

listen on both ipv4 and ipv6 #179

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

listen on both ipv4 and ipv6 #179

wants to merge 1 commit into from

Conversation

aptalca
Copy link
Member

@aptalca aptalca commented Apr 21, 2024

closes #178

@aptalca aptalca requested a review from a team April 21, 2024 14:27
@LinuxServer-CI
Copy link
Collaborator

I am a bot, here are the test results for this PR:
https://ci-tests.linuxserver.io/lspipepr/code-server/4.23.1-pkg-4284c89d-dev-79293112331036168cc4031bfe7c961af30d0498-pr-179/index.html
https://ci-tests.linuxserver.io/lspipepr/code-server/4.23.1-pkg-4284c89d-dev-79293112331036168cc4031bfe7c961af30d0498-pr-179/shellcheck-result.xml

Tag Passed
amd64-4.23.1-pkg-4284c89d-dev-79293112331036168cc4031bfe7c961af30d0498-pr-179
arm64v8-4.23.1-pkg-4284c89d-dev-79293112331036168cc4031bfe7c961af30d0498-pr-179

Copy link
Member

@thespad thespad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this going to suddenly break a bunch of users who've explicitly disabled IPv6?

@aptalca
Copy link
Member Author

aptalca commented Apr 21, 2024

No idea. It needs to be tested.

I'm surprised that even though we're telling it to listen on ipv6, it also listens on ipv4 but I couldn't find any documentation. Just github issue discussions.

@thespad
Copy link
Member

thespad commented Apr 21, 2024

Well that's just weird:

# netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp6       0      0 :::8443                 :::*                    LISTEN      -   
$  docker ps | grep code
30ff101cac53   lspipepr/code-server:4.23.1-pkg-4284c89d-dev-79293112331036168cc4031bfe7c961af30d0498-pr-179   "/init"                  3 seconds ago   Up 3 seconds           0.0.0.0:8123->8443/tcp, :::8123->8443/tcp   

And both

curl -4 -sL http://localhost:8123

And

curl -6 -sL http://localhost:8123

Work. They also work inside the container so it's not just the docker NAT layer doing something odd.

@thespad
Copy link
Member

thespad commented Apr 21, 2024

TIL https://www.rfc-editor.org/rfc/rfc3493#section-3.7

Applications may use AF_INET6 sockets to open TCP connections to IPv4
nodes, or send UDP packets to IPv4 nodes, by simply encoding the
destination's IPv4 address as an IPv4-mapped IPv6 address, and
passing that address, within a sockaddr_in6 structure, in the
connect() or sendto() call. When applications use AF_INET6 sockets
to accept TCP connections from IPv4 nodes, or receive UDP packets
from IPv4 nodes, the system returns the peer's address to the
application in the accept(), recvfrom(), or getpeername() call using
a sockaddr_in6 structure encoded this way.

Also https://www.rfc-editor.org/rfc/rfc3493#section-5.3

As stated in section <3.7 Compatibility with IPv4 Nodes>,
AF_INET6 sockets may be used for both IPv4 and IPv6 communications.
Some applications may want to restrict their use of an AF_INET6
socket to IPv6 communications only. For these applications the
IPV6_V6ONLY socket option is defined.

But that will still break with IPv4-only network stacks for obvious reasons.

@miyurusankalpa
Copy link

@thespad It will break on users who have disabled IPv6 on the kernel level, others will have no issues. Those who have will aware of the issues with messing with the default kernel values.

As IPv6 only servers are becoming common, having a middle ground is the better option.

It will be better to have a DISABLE IPv6 option for such users, as it done on the kasmvnc image.

https://github.com/linuxserver/docker-baseimage-kasmvnc/blob/master/root/etc/s6-overlay/s6-rc.d/init-nginx/run#L29

@drizuid
Copy link
Member

drizuid commented Apr 23, 2024

Is this going to suddenly break a bunch of users who've explicitly disabled IPv6?

hopefully, maybe it'll teach them to stop doing silly things left over from 2004

@LinuxServer-CI
Copy link
Collaborator

I am a bot, here are the test results for this PR:
https://ci-tests.linuxserver.io/lspipepr/code-server/4.89.1-pkg-2e2dbd2e-dev-43762e8d1a1bb73155a207732b808ca9c656e210-pr-179/index.html
https://ci-tests.linuxserver.io/lspipepr/code-server/4.89.1-pkg-2e2dbd2e-dev-43762e8d1a1bb73155a207732b808ca9c656e210-pr-179/shellcheck-result.xml

Tag Passed
amd64-4.89.1-pkg-2e2dbd2e-dev-43762e8d1a1bb73155a207732b808ca9c656e210-pr-179
arm64v8-4.89.1-pkg-2e2dbd2e-dev-43762e8d1a1bb73155a207732b808ca9c656e210-pr-179

@LinuxServer-CI
Copy link
Collaborator

I am a bot, here are the test results for this PR:
https://ci-tests.linuxserver.io/lspipepr/code-server/4.90.2-pkg-ec2f2738-dev-6c3977dd4e90cacbac808c7c46de0104cdf7ea5f-pr-179/index.html
https://ci-tests.linuxserver.io/lspipepr/code-server/4.90.2-pkg-ec2f2738-dev-6c3977dd4e90cacbac808c7c46de0104cdf7ea5f-pr-179/shellcheck-result.xml

Tag Passed
amd64-4.90.2-pkg-ec2f2738-dev-6c3977dd4e90cacbac808c7c46de0104cdf7ea5f-pr-179
arm64v8-4.90.2-pkg-ec2f2738-dev-6c3977dd4e90cacbac808c7c46de0104cdf7ea5f-pr-179

@LinuxServer-CI
Copy link
Collaborator

I am a bot, here are the test results for this PR:
https://ci-tests.linuxserver.io/lspipepr/code-server/4.91.0-pkg-a6b2b800-dev-17b95b0ba62f66e6b818a6d5f7d4e1f17a6312a9-pr-179/index.html
https://ci-tests.linuxserver.io/lspipepr/code-server/4.91.0-pkg-a6b2b800-dev-17b95b0ba62f66e6b818a6d5f7d4e1f17a6312a9-pr-179/shellcheck-result.xml

Tag Passed
amd64-4.91.0-pkg-a6b2b800-dev-17b95b0ba62f66e6b818a6d5f7d4e1f17a6312a9-pr-179
arm64v8-4.91.0-pkg-a6b2b800-dev-17b95b0ba62f66e6b818a6d5f7d4e1f17a6312a9-pr-179

@LinuxServer-CI
Copy link
Collaborator

I am a bot, here are the test results for this PR:
https://ci-tests.linuxserver.io/lspipepr/code-server/4.91.1-pkg-ab8f4cb9-dev-7655e6e780d64c3c870568720211f53b4cb5814c-pr-179/index.html
https://ci-tests.linuxserver.io/lspipepr/code-server/4.91.1-pkg-ab8f4cb9-dev-7655e6e780d64c3c870568720211f53b4cb5814c-pr-179/shellcheck-result.xml

Tag Passed
amd64-4.91.1-pkg-ab8f4cb9-dev-7655e6e780d64c3c870568720211f53b4cb5814c-pr-179
arm64v8-4.91.1-pkg-ab8f4cb9-dev-7655e6e780d64c3c870568720211f53b4cb5814c-pr-179

@LinuxServer-CI
Copy link
Collaborator

This pull request has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

@EricSeastrand
Copy link

This feature would help me. I'm embracing v6 everywhere on my network and would love to have Code Server along for the ride.

@EricSeastrand
Copy link

Sorry for the dumb question, but how can I help test this updated image? Do I just point my docker compose file to this version? amd64-4.91.1-pkg-ab8f4cb9-dev-7655e6e780d64c3c870568720211f53b4cb5814c-pr-179

I still have a few v4-only hosts in my network. Curious to see what breaks.

@thespad
Copy link
Member

thespad commented Sep 29, 2024

amd64-4.91.1-pkg-ab8f4cb9-dev-7655e6e780d64c3c870568720211f53b4cb5814c-pr-179

Yes, that's the image tag for the PR build

@LinuxServer-CI
Copy link
Collaborator

This pull request has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

@tibeer
Copy link

tibeer commented Oct 30, 2024

Let's keep this open :)

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

Successfully merging this pull request may close these issues.

[FEAT] Bind to IPv6 Address as well
7 participants