Aspire DCP API-Server, IPv6 and devcontainers #2852
|
Currently, the DCP API-server starts litening on the IPv6 info: Aspire.Hosting.Dcp.api-server[0]
API server started {"Address": "::1", "Port": 11669}is it possible to configure the DCP to listen on a specific interface, e.g. IPv4 127.0.0.1 interface? Background: I'm facing issues (related to #1976 ) stating the aspire host on my work machine (Windows 10) while the same project runs seamlessly on my private machine, and I think it's related to my proxy settings EDIT: |
Replies: 6 comments 1 reply
|
Thanks for the question Mouaad Gssair (@GMouaad) Currently the interface/port used by DCP is outside of developer control. For the interface, DCP will examine available loopback interfaces on the machine, and if IPv4 and IPv6 are both available, it will use IPv6. I am going to close this as "not planned" because, well, we currently have no plans to open the DCP interface/port for customization. |
|
I'm having a problem where I cannot use Aspire in a devcontainer because of this. This is odd to me because Aspire is a devcontainer feature you can install from vscode. Docker typically doesn't have IPv6 support. I used the aspire-starter template. |
|
I have also tried enabling IPv6 and tried a devcontainer on bare metal linux with the same results. |
|
Final follow-up for people also having this issue. While configuring the interface for DCP would have been a nice workaround, I found a solution for enabling ipv6 in the devcontainer. I used the docker docs page on ipv6. For both Linux and Windows I used the second option of modifying the default docker network interface. I mentioned previously I could not get Aspire to work on Linux with the same error. I was mistaken; there was an error in my config. Once I corrected that config I was able to use Aspire in a devcontainer. Windows has a trick. Edit your Final note. By what metric does DCP determine if IPv6 is "available"? When I did not have IPv6 enabled, it was still trying to bind to ::1 Reference to similar error for discoverability #940 |
|
Jesse C (@FracturedCode) thanks a ton. I am going to convert it to a discussion because I think a lot of Aspire users may benefit from what you have worked out. To answer your question, to determine what IP address to use for the API server, DCP calls net.LookupIP passing "localhost" and uses the first IP address returned by it. |
|
Should we turn this into a doc David Pine (@IEvangelist) ? |
Final follow-up for people also having this issue. While configuring the interface for DCP would have been a nice workaround, I found a solution for enabling ipv6 in the devcontainer.
I used the docker docs page on ipv6. For both Linux and Windows I used the second option of modifying the default docker network interface.
I mentioned previously I could not get Aspire to work on Linux with the same error. I was mistaken; there was an error in my config. Once I corrected that config I was able to use Aspire in a devcontainer.
Windows has a trick. Edit your
daemon.jsondirectly (%userprofile%/.docker/daemon.json) instead of in the docker desktop UI. For some reason, the UI didn't like any ip…