Skip to content

Conversation

gaius-qi
Copy link
Member

Description

This pull request adds support for including the server's IP address in the response headers for requests handled by the Dragonfly proxy. The main focus is to provide clients with information about which server processed their request by introducing a new response header and updating the relevant code paths to populate it.

Header support improvements:

  • Introduced a new constant DRAGONFLY_SERVER_IP_HEADER in header.rs to represent the response header key for the server's IP address.
  • Updated the make_response_headers function in mod.rs to accept a server_ip parameter and insert the server IP into the response headers using the new header key. [1] [2]
  • Modified the call to make_response_headers in proxy_via_dfdaemon to pass the server's IP address from the configuration.

Related Issue

Motivation and Context

Screenshots (if appropriate)

Signed-off-by: Gaius <gaius.qi@gmail.com>
@gaius-qi gaius-qi added this to the v2.4.0 milestone Aug 20, 2025
@gaius-qi gaius-qi self-assigned this Aug 20, 2025
@gaius-qi gaius-qi added the enhancement New feature or request label Aug 20, 2025
Copy link
Member

@chlins chlins left a comment

Choose a reason for hiding this comment

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

lgtm

@chlins chlins enabled auto-merge (squash) August 20, 2025 04:18
@chlins chlins merged commit bb94a4f into main Aug 20, 2025
9 checks passed
@chlins chlins deleted the feature/server-ip branch August 20, 2025 04:20
Copy link

codecov bot commented Aug 20, 2025

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.72%. Comparing base (e065ee0) to head (e3045aa).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
dragonfly-client/src/proxy/mod.rs 0.00% 6 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1295      +/-   ##
==========================================
- Coverage   48.74%   48.72%   -0.02%     
==========================================
  Files          60       60              
  Lines       15072    15078       +6     
==========================================
  Hits         7347     7347              
- Misses       7725     7731       +6     
Files with missing lines Coverage Δ
dragonfly-client/src/proxy/header.rs 92.07% <ø> (ø)
dragonfly-client/src/proxy/mod.rs 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants