Skip to content

feat: Add http_proxy option to route SDK requests through a web proxy - #270

Merged
jsonbailey merged 5 commits into
mainfrom
jb/sdk-3304/php-http-proxy
Oct 14, 2026
Merged

jsonbailey merged 5 commits into
mainfrom
jb/sdk-3304/php-http-proxy

Conversation

@jsonbailey

@jsonbailey jsonbailey commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

fix: Prevent special characters in the events URI or temp file path from breaking event delivery on Windows

Summary

Adds an http_proxy client option that sends all SDK requests to LaunchDarkly through a web proxy. The value is a proxy URL, for example http://my-proxy:8080 or http://user:pass@my-proxy:8080. This matches the proxy option in the Python and Go SDKs.

  • The Guzzle feature requester, the Guzzle event publisher, and the default curl event publisher all use the option. Guzzle gets it as its proxy request option, and the curl publisher passes --proxy to curl.
  • The proxy is used for both HTTP and HTTPS targets.
  • The option overrides the HTTPS_PROXY and HTTP_PROXY environment variables for SDK connections. The NO_PROXY environment variable still applies, because curl reads it. If the option is not set, the environment variables apply as before.
  • On Windows, the curl publisher uses PowerShell Invoke-WebRequest -Proxy, which does not read credentials from the proxy URL. For a proxy that requires authentication on Windows, use Guzzle::eventPublisher(). The Curl docblock documents this.
  • An http_proxy value that is not a non-empty string is ignored with a warning, and the environment variables apply.

Note

Overview
Adds a new http_proxy client configuration option so LaunchDarkly HTTP traffic can be sent through an explicit proxy URL (aligned with other LaunchDarkly SDKs).

Util::httpProxy() centralizes parsing: only non-empty strings are honored; invalid values are logged and ignored so default proxy environment behavior is unchanged when the option is absent or bad.

The Guzzle feature requester and event publisher pass the URL as Guzzle’s proxy option. The default curl event publisher adds --proxy on Unix and Invoke-WebRequest -Proxy on Windows. Docs on LDClient and the integration factories describe precedence over HTTP_PROXY/HTTPS_PROXY for SDK calls only, plus the Windows PowerShell credential limitation.

Curl event publisher also tightens PowerShell quoting for payload file paths and URIs. Tests cover curl argument wiring and integration paths that only succeed when traffic goes through a local proxy.

Reviewed by Cursor Bugbot for commit 3f6f862. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread src/LaunchDarkly/Integrations/Curl.php Outdated
Comment thread src/LaunchDarkly/Impl/Integrations/CurlEventPublisher.php
@kinyoklion

Copy link
Copy Markdown
Member
The option has priority over the proxy environment variables, such as HTTPS_PROXY, for SDK connections only. If the option is not set, behavior does not change and the environment variables still apply.

This doesn't appear to be accurate. CURL reads the proxy environment variables directly and no_proxy overrides the manually specified proxy configuration.

@jsonbailey
jsonbailey marked this pull request as ready for review October 13, 2026 23:14
@jsonbailey
jsonbailey requested a review from a team as a code owner October 13, 2026 23:15
@jsonbailey

Copy link
Copy Markdown
Contributor Author

This doesn't appear to be accurate. CURL reads the proxy environment variables directly and no_proxy overrides the manually specified proxy configuration.

It was fixed in the code docs but not in the PR description. I've updated it.

@jsonbailey
jsonbailey requested a review from kinyoklion October 13, 2026 23:21
@jsonbailey
jsonbailey merged commit fa5b955 into main Oct 14, 2026
22 checks passed
@jsonbailey
jsonbailey deleted the jb/sdk-3304/php-http-proxy branch October 14, 2026 17:08
jsonbailey pushed a commit that referenced this pull request Oct 14, 2026
🤖 I have created a release *beep* *boop*
---


##
[6.10.0](6.9.0...6.10.0)
(2026-10-14)


### Features

* Add http_proxy option to route SDK requests through a web proxy
([#270](#270))
([fa5b955](fa5b955))


### Bug Fixes

* Prevent special characters in the events URI or temp file path from
([fa5b955](fa5b955))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Overview**
> **Release 6.10.0** — bumps the SDK version from **6.9.0** to
**6.10.0** across `LDClient::VERSION`, `.release-please-manifest.json`,
and the phpDoc build title.
> 
> Adds a **CHANGELOG** entry for 6.10.0 that records already-merged
work: an **`http_proxy`** client option for proxying SDK HTTP traffic,
and a fix around **special characters in the events URI or temp file
paths** (no runtime code changes in this diff).
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
95f8bfc. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

2 participants