Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
spring-projects-issues opened this issue Jun 20, 2010 · 1 comment
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

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

@spring-projects-issues
Copy link
Collaborator Author

Arjen Poutsma commented

Done, the SimpleClientHttpRequestFactory now has a Proxy property.

I've also added o.s.http.client.support.ProxyFactoryBean, to allow for easier configuration of java.net.Proxy in Spring XML app contexts.

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: web Issues in web modules (web, webmvc, webflux, websocket) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 3.0.4 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants