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.
This change adds support for SOCKS4 and SOCKS5 proxies. The use case I have is to test Ratpack services as if they are part of a test environment network. SOCKS proxies offer remote DNS resolution capabilities that allow the service to resolve internal hostnames for the target network/environment. I saw that Netty already has support for SOCKS proxies, but Ratpack was not exposing it.
Example usage:
I explored a few other options here as well. Instead of a SOCKS proxy you can just use local port forwarding, but if there are a lot of different upstreams then it can be quite tedious to forward all the ports and reconfigure the app to use the proper ports for each upstream. The JVM also has
socksProxyHost
andsocksProxyPort
flags, but unfortunately there is a bug in the JVM that prevents remote DNS from working properly when using those, so this was the next best approach.This change is