mitre / HTTP-Proxy-Servlet

Smiley's HTTP Proxy implemented as a Java servlet
Apache License 2.0
1.46k stars 554 forks source link

Using another proxy server in this chain #154

Open ramizdemiurge opened 5 years ago

ramizdemiurge commented 5 years ago

Can I use a proxy server for this? And is it possible to dynamically add a proxy to the chain? I will try to explain what I want to say: There is a Glype program written in php. It allows you to surf the Internet with another ip. I have a proxy list with which I want to use this library.

I use Spring boot

dsmiley commented 5 years ago

You can configure this servlet to use an HTTP Proxy Server, if that's what you mean. This can be done with standard Java system properties, or you could subclass and configure it explicitly.

ramizdemiurge commented 5 years ago

you could subclass and configure it explicitly

Well, that is what I need because there are a lot of proxies to choose from in real time. What class I should extend? Can you help me with this?

Thank you!

dsmiley commented 5 years ago

I can't really help other than point you in a useful direction. You could investigate the Apache HttpClient API to see what options it offers. The servlet uses that to do the request, and that API is very rich/extensive. That's where most of the work will probably be. Once you've figured out how to make HttpClient do dynamic proxy'ing, then all you'd have to do with the servlet is override to configure your customized HttpClient in createHttpClient().