Skip to content

feat: discover and authenticate Sunshine hosts - #405

Merged
ReenigneArcher merged 10 commits into
masterfrom
codex/host-discovery
Dec 6, 2026
Merged

ReenigneArcher merged 10 commits into
masterfrom
codex/host-discovery

Conversation

@ReenigneArcher

Copy link
Copy Markdown
Member

Description

Add automatic Sunshine discovery on desktop, mobile, and TV, with manual entry still available. Desktop, mobile, and TV support IPv4 and IPv6, including scoped link-local addresses. The original Xbox continues to discover and connect over IPv4.

Save the server certificate verified during PIN pairing and pin subsequent HTTPS requests. Verify the certificate before moving a saved host to a newly discovered address or port. Keep distinct Sunshine instances on the same IP separate, including instances listening on different ports. A verified dual-stack host can use a single tile and fall back to its alternate address. Existing pairings can establish a pin with Host Actions → Pair Again.

Screenshot

Issues Fixed or Closed

Roadmap Issues

Testing

  • Windows UCRT64 client build and ctest --test-dir cmake-build-client-ucrt64 --output-on-failure passed all 571 tests. Regression coverage includes same-IP instances, certificate pinning and relocation, a shared certificate, dual-stack failover, and scoped IPv6 input.
  • The Android ARM64 debug APK and strict Dockle API documentation built. Live Linux IPv6 smoke tests exercised scoped mDNS discovery, certificate validation and wrong-pin rejection, and the HTTPS stream launch request.
  • The changed Xbox sources passed XBDK compiler syntax checks. The installed SDK lacks the required title-ID packaging support. The Bonjour adapter was syntax-checked against Apple's header. Apple device builds, Flatpak LAN discovery, and real-device streaming remain unverified.

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
  • Tests have been added or updated for new or modified functionality, including regression tests for bug fixes

AI Usage

See our AI usage policy.

  • AI tools were used while preparing this PR

@codecov

codecov Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.12710% with 37 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.68%. Comparing base (c092cb5) to head (16c05d5).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/network/host_pairing.cpp 85.71% 15 Missing ⚠️
src/app/client_state.cpp 92.59% 13 Missing and 1 partial ⚠️
src/app/host_records.cpp 92.45% 4 Missing ⚠️
src/network/host_address.cpp 91.42% 3 Missing ⚠️
src/network/host_discovery.cpp 75.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #405      +/-   ##
==========================================
+ Coverage   88.81%   89.68%   +0.87%     
==========================================
  Files          82       83       +1     
  Lines        9446     9493      +47     
  Branches     4066     4149      +83     
==========================================
+ Hits         8389     8514     +125     
+ Misses        948      867      -81     
- Partials      109      112       +3     
Flag Coverage Δ
Linux-aarch64 74.77% <62.46%> (-0.40%) ⬇️
Linux-x86_64 74.85% <62.46%> (-0.40%) ⬇️
Windows-AMD64 76.82% <65.93%> (-0.31%) ⬇️
Windows-ARM64 76.76% <65.93%> (-0.30%) ⬇️
Xbox-guest-xemu-Linux 73.76% <67.25%> (+1.82%) ⬆️
Xbox-guest-xemu-Windows 73.76% <67.25%> (+1.81%) ⬆️
Xbox-guest-xemu-macOS 73.76% <67.25%> (+1.82%) ⬆️
macOS-arm64 64.80% <52.13%> (-0.15%) ⬇️
macOS-x86_64 64.88% <51.42%> (-0.17%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/app/client_state.h 79.20% <ø> (ø)
src/app/host_records.h 100.00% <100.00%> (ø)
src/app/screenshot_library.cpp 96.50% <100.00%> (-0.50%) ⬇️
src/network/host_discovery.h 100.00% <ø> (ø)
src/network/host_pairing.h 75.00% <ø> (+75.00%) ⬆️
src/ui/host_probe_result_queue.cpp 72.97% <100.00%> (+0.75%) ⬆️
src/ui/host_probe_result_queue.h 100.00% <100.00%> (ø)
src/ui/shell_view.cpp 96.50% <100.00%> (+0.04%) ⬆️
src/network/host_discovery.cpp 65.81% <75.00%> (+30.62%) ⬆️
src/network/host_address.cpp 91.42% <91.42%> (ø)
... and 3 more

... and 6 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c092cb5...16c05d5. Read the comment docs.

@github-actions

github-actions Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

@ReenigneArcher ReenigneArcher left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I found three issues in the host lifecycle that should be fixed before merging. They affect saving a pin after pairing from a host tile, recovering from a changed certificate, and ordering saved probes ahead of discovered endpoint changes.

The Windows UCRT64 build and all 571 registered tests passed on this head. The suggested changes were reviewed by inspection.

Review completed by Codex | Model: gpt-6.2-sol | Thinking: xhigh

Comment thread src/ui/shell_screen.cpp Resolved
Comment thread src/app/client_state.cpp Resolved
Comment thread src/ui/shell_screen.cpp Resolved
@ReenigneArcher
ReenigneArcher marked this pull request as ready for review December 5, 2026 21:02

@ReenigneArcher ReenigneArcher left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The previous three findings are fixed on this head. Pairing saves the full host identity, Pair Again can open for a host marked offline, and the probe queue captures results and completion under the same lock.

One issue remains before merging. A saved and authenticated alternate address is discarded when another saved instance shares the certificate. The Windows UCRT64 build, all 573 registered tests, and git diff --check passed. A focused regression reproduced the remaining issue and passed with the inline suggestion in a temporary build.

Review completed by Codex | Model: gpt-6.2-sol | Thinking: xhigh

Comment thread src/app/client_state.cpp Resolved

@ReenigneArcher ReenigneArcher left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The earlier findings stay fixed on this head. The remaining code-review blockers are two cpp:S3776 findings in the live SonarQube quality gate. The inline comments show focused refactors. All 80 client-state tests passed with both suggestions in a temporary Windows build. Hosted SonarQube will need to confirm the reduced scores after a fix is pushed.

The Windows UCRT64 build, all 580 registered tests, the local Xbox release build, and git diff --check passed on this head. The failed iOS, tvOS, and macOS x86_64 jobs stopped while cloning dependencies before compiling the client.

Review completed by Codex | Model: gpt-6.2-sol | Thinking: xhigh

Comment thread src/app/client_state.cpp Resolved
Comment thread src/app/client_state.cpp Resolved
@sonarqubecloud

sonarqubecloud Bot commented Dec 5, 2026

Copy link
Copy Markdown

@ReenigneArcher
ReenigneArcher merged commit 1eeb476 into master Dec 6, 2026
38 checks passed
@ReenigneArcher
ReenigneArcher deleted the codex/host-discovery branch December 6, 2026 00:12
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.

1 participant