Skip to content

o.s.http.client.SimpleClientHttpRequestFactory does not allow to specify a java.net.Proxy [SPR-7305] #11964

@spring-projects-issues

Description

@spring-projects-issues

Cédrik LIME opened SPR-7305 and commented

While working with the new ClientHttpRequestFactory, I need to create an outgoing HTTP connection via a proxy.
ClientHttpRequestFactory has 2 implementations: commons-http and simple (Java native).
While I can specify a proxy using CommonsClientHttpRequestFactory (it exposes the HttpClient instance), this is not true of SimpleClientHttpRequestFactory.

To fix this problem, you need to externalise the 1st line of SimpleClientHttpRequestFactory#createRequest(URI, HttpMethod) so that we can subclass uri.toURL().openConnection() to read uri.toURL().openConnection(someProxy) when needed.


Affects: 3.0.3

Referenced from: commits c059f53

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions