Skip to content

Commit

Permalink
Add javadoc for ProxyHandler and its implementations (#13638)
Browse files Browse the repository at this point in the history
Motivation:

Clarify purpose of `ProxyHandler`, `HttpProxyHandler`,
`Socks4ProxyHandler`, and `Socks5ProxyHandler`.

Modifications:

Add javadocs

Result:

Make it more clear when to use which handler.
  • Loading branch information
idelpivnitskiy committed Sep 25, 2023
1 parent 1420272 commit 7685b7d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@
import java.net.InetSocketAddress;
import java.net.SocketAddress;

/**
* Handler that establishes a blind forwarding proxy tunnel using
* <a href="https://datatracker.ietf.org/doc/html/rfc7231#section-4.3.6">HTTP/1.1 CONNECT</a> request. It can be used to
* establish plaintext or secure tunnels.
* <p>
* HTTP users who need to connect to a
* <a href="https://datatracker.ietf.org/doc/html/rfc7230#page-10">message-forwarding HTTP proxy agent</a> instead of a
* tunneling proxy should not use this handler.
*/
public final class HttpProxyHandler extends ProxyHandler {

private static final String PROTOCOL = "http";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
import java.nio.channels.ConnectionPendingException;
import java.util.concurrent.TimeUnit;

/**
* A common abstraction for protocols that establish blind forwarding proxy tunnels.
*/
public abstract class ProxyHandler extends ChannelDuplexHandler {

private static final InternalLogger logger = InternalLoggerFactory.getInstance(ProxyHandler.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
import java.net.InetSocketAddress;
import java.net.SocketAddress;

/**
* Handler that establishes a blind forwarding proxy tunnel using
* <a href="https://www.openssh.com/txt/socks4.protocol">SOCKS4</a> protocol.
*/
public final class Socks4ProxyHandler extends ProxyHandler {

private static final String PROTOCOL = "socks4";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
import java.util.Arrays;
import java.util.Collections;

/**
* Handler that establishes a blind forwarding proxy tunnel using
* <a href="https://www.rfc-editor.org/rfc/rfc1928">SOCKS Protocol Version 5</a>.
*/
public final class Socks5ProxyHandler extends ProxyHandler {

private static final String PROTOCOL = "socks5";
Expand Down

0 comments on commit 7685b7d

Please sign in to comment.