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

Use "localhost" instead of "127.0.0.1" for the sidecar host address #1032

Open
cgillum opened this issue Feb 11, 2023 · 3 comments · May be fixed by #1040
Open

Use "localhost" instead of "127.0.0.1" for the sidecar host address #1032

cgillum opened this issue Feb 11, 2023 · 3 comments · May be fixed by #1040

Comments

@cgillum
Copy link
Contributor

cgillum commented Feb 11, 2023

Describe the proposal

Currently we use 127.0.0.1 when accessing the Dapr sidecar from the .NET SDK. This is hardcoded here. We should change this to instead be localhost because:

  1. 127.0.0.1 only works with IPv4 whereas localhost works with both IPv4 and IPv6.
  2. Unlike with localhost, using 127.0.0.1 can't resolve to local WSL2 endpoints from the Windows OS, which is a hindrance for local dev/test on Windows.

As an alternative, we could consider making the host address configurable via an environment variable.

@ondmal
Copy link

ondmal commented Feb 15, 2023

Hi @cgillum.

As an alternative, we could consider making the host address configurable via an environment variable.

  • Do you have any proposal for the environment variable name?
  • Do you still want to use localhost if the environment variable is not defined?

@cgillum
Copy link
Contributor Author

cgillum commented Feb 15, 2023

Thanks for the response @ondmal.

Do you have any proposal for the environment variable name?

Just throwing this out there, but how about DAPR_HOST?

Do you still want to use localhost if the environment variable is not defined?

Yes, the switch to localhost solves the immediate blockers that I'm running into more easily than an environment variable would.

@ondmal
Copy link

ondmal commented Feb 15, 2023

I do not know the system well, so I can´t say what is already reserved. But DAPR_HOST looks good to me.

EDIT: Looks like DAPR_HOST is good fit, since it is already used in the code base:

https://github.com/search?p=1&q=org%3Adapr+DAPR_HOST&type=Code

but it is missing here in docs: https://docs.dapr.io/reference/environment/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants
@cgillum @ondmal and others