Skip to content

fix: show actual bind address in Web UI log message#4897

Open
aliefe04 wants to merge 1 commit intoLizardByte:masterfrom
aliefe04:fix/webui-bind-address-log
Open

fix: show actual bind address in Web UI log message#4897
aliefe04 wants to merge 1 commit intoLizardByte:masterfrom
aliefe04:fix/webui-bind-address-log

Conversation

@aliefe04
Copy link
Contributor

@aliefe04 aliefe04 commented Mar 23, 2026

Description

When running multiple Sunshine instances with different bind_address values, the log message always showed localhost instead of the actual IP address. This made it confusing to know which URL to use for each instance's Web UI.

This PR modifies the log message in confighttp.cpp to show the configured bind_address when set, and falls back to localhost when binding to all interfaces (wildcard address).

Screenshot

Before:

Configuration UI available at [https://localhost:47990]

After:
With bind_address = 10.124.62.47:

Configuration UI available at [https://10.124.62.47:47990]

Without bind_address (default):

Configuration UI available at [https://localhost:47990]

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

When running multiple Sunshine instances with different bind_address
values, the log message always showed 'localhost' instead of the
actual IP address. This made it confusing to know which URL to use
for each instance's Web UI.

Now shows the configured bind_address when set, or 'localhost' as
a fallback when binding to all interfaces (wildcard).

Fixes LizardByte#4638
@sonarqubecloud
Copy link


// Store bind address for logging, use "localhost" as fallback for wildcard addresses
const auto bind_addr = server.config.address;
const auto display_addr = config::sunshine.bind_address.empty() ? "localhost"sv : std::string_view {bind_addr};
Copy link
Member

Choose a reason for hiding this comment

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

Could you check if the function mentioned in #4638 (comment) would return what we need?

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.

Same Web UI port when running Sunshine with bind_address

2 participants