Skip to content

Conversation

mnothman
Copy link

Description

Settings.getDefaultHost() was hardcoded to return "127.0.0.1", ignoring the DAPR_RUNTIME_HOST environment variable. This meant users couldn't configure the client host via environment variables when running Dapr with custom ports.

Solution: Added support for the DAPR_RUNTIME_HOST environment variable in Settings.getDefaultHost():

Now users can configure both host and port via environment variables when Dapr CLI sets them automatically.

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #646

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

@mnothman mnothman requested review from a team as code owners September 24, 2025 00:41
Problem:
getDefaultHttpPort() already respected DAPR_HTTP_PORT however, settings.getDefaultHost() did not use DAPR_RUNTIME_HOST

Solution: (closes Custom sidecar port
Fixes dapr#646)
-Added DAPR_RUNTIME_HOST env variable support to Settings.getDefaultHost()

Now users can set both DAPR_RUNTIME_HOST and DAPR_HTTP_PORT to fully control where client connects

Tests:
Created new dedicated test file for env mutations, so as to not mix up jest.isolateModules and top level Settings import

Signed-off-by: mnothman <[email protected]>
Signed-off-by: mnothman <[email protected]>
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

Successfully merging this pull request may close these issues.

Custom sidecar port
1 participant