Skip to content

add proxy-header support - #912

Merged
glbrntt merged 4 commits into
swift-server:mainfrom
benrobby:proxy-connect-headers
Jul 23, 2026
Merged

add proxy-header support#912
glbrntt merged 4 commits into
swift-server:mainfrom
benrobby:proxy-connect-headers

Conversation

@benrobby

Copy link
Copy Markdown
Contributor

Motivation:

when connecting via a HTTP proxy, this now allows users to set HTTP headers on the CONNECT request to the proxy. This is useful for caller attribution purposes.

Modifications:

  • adds a connectHeaders parameter to HTTPClient.Configuration
  • parses connectHeaders swift-configuration property as list of colon-separated key: value pairs
  • sets proxy headers on CONNECT request

Result:
implements proxy-header support

Motivation:

when connecting via HTTP proxy, allow users to set HTTP headers on the CONNECT request to the proxy. This is useful for attribution purposes.

Modifications:
- adds a `connectHeaders` parameter to HTTPClient.Configuration
- parses `connectHeaders` swift-configuration property as list of colon-separated `key: value` pairs
- sets proxy headers on CONNECT request

Result:
implements proxy-header support
@benrobby
benrobby force-pushed the proxy-connect-headers branch from b41c2bc to 777e3ee Compare July 23, 2026 07:22

@glbrntt glbrntt left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM module a couple of nits

Comment thread Sources/AsyncHTTPClient/HTTPClient+Proxy.swift Outdated
Comment thread Sources/AsyncHTTPClient/HTTPClient+Proxy.swift
@benrobby
benrobby requested a review from glbrntt July 23, 2026 11:07
Comment thread Sources/AsyncHTTPClient/HTTPClient+Proxy.swift Outdated

@glbrntt glbrntt left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice patch, thank you!

@glbrntt glbrntt added the 🆕 semver/minor Adds new public API. label Jul 23, 2026
@glbrntt
glbrntt enabled auto-merge (squash) July 23, 2026 11:50
@glbrntt
glbrntt merged commit 9544287 into swift-server:main Jul 23, 2026
36 checks passed
@benrobby
benrobby deleted the proxy-connect-headers branch July 23, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🆕 semver/minor Adds new public API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants