Repository navigation
Fix Net::HTTP, HTTP.rb, RestClient, and Faraday CONNECT headers - #48
Merged
Merged
Conversation
cursor
Bot
force-pushed
the
cursor/fix-connect-adapters-8740
branch
from
November 12, 2026 22:19
c429353 to
45fc194
Compare
Base automatically changed from
cursor/typhoeus-native-proxyheader-8740
to
main
November 13, 2026 02:50
Stop copying Net::HTTP#connect. HTTP.rb uses its own proxy headers, RestClient keeps using Net::HTTP, and Faraday reads the CONNECT response through public adapter methods. Co-authored-by: ProxyMesh AI <proxymeshai@users.noreply.github.com>
The live harness only reads Hash headers, and HTTP::Headers is not a Hash, so X-ProxyMesh-IP was missing for that client. Co-authored-by: ProxyMesh AI <proxymeshai@users.noreply.github.com>
Rewrite CONNECT bytes only while a patched connection is opening, and leave the WebMock class swap in the specs. HTTP.rb client options are passed through instead of dropped. Co-authored-by: ProxyMesh AI <proxymeshai@users.noreply.github.com>
proxymesh
force-pushed
the
cursor/fix-connect-adapters-8740
branch
from
November 13, 2026 02:50
45fc194 to
7f0dbbe
Compare
proxymesh
approved these changes
Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Net::HTTP#connectwas a copy of the Ruby 3.2 method, so it drifted from the installed net-http (timeouted_connect, HTTPS proxies). HTTP.rb and RestClient also called the missingRubyProxyHeaders::NetHTTP.request.X-ProxyMesh-IPis case-insensitive.patch!still applies after WebMock swapsNet::HTTPout and restores it.proxy_headerson CONNECT itself.proxy_response_headersreadsresponse.proxy_headers.Net::HTTPobject RestClient builds.request_with_wrapped_block. It uses publicbuild_connectionandcall.CONNECT headers are not copied onto the origin request. Version stays 0.2.3.
Local mock proxy on Ruby 3.2.3 with the locked gems (net-http 0.10.0, faraday-net_http 3.5.0, http 6.0.4, rest-client 2.1.0): Net::HTTP, HTTP.rb, RestClient, Faraday, and HTTParty each sent
X-ProxyMesh-Countryonly on CONNECT, keptX-App-Secreton the origin request, and readX-ProxyMesh-IP. An HTTPS proxy (proxy_use_ssl) started with a TLS handshake and still carried the custom CONNECT header.bundle exec rspecwas 41 examples, 0 failures, 6 pending.Merge after #47. The docs PR is stacked on this branch.