issue#101: Socks 4/5 Proxy handler in NetClient

add SOCKS proxy support to HttpClient and NetClient
changed proxy options into a ProxyObject class
add small socks4/5 proxy for testing
move proxyOptions property to ClientOptionsBase
add unit tests
add missing ctx.fireXXX in VertxHandler
move ProxyChannelProvider to its own package
add classnotfound check to NetClientImpl
add to documentation about proxy config

Signed-off-by: alexlehm <alexlehm@gmail.com>
This commit is contained in:
alexlehm
2016-05-24 00:14:32 +02:00
committed by Julien Viet
parent 40f4f4353a
commit 73dec74a82
30 changed files with 1428 additions and 301 deletions

View File

@@ -21,6 +21,8 @@ import io.vertx.core.Vertx;
import io.vertx.core.buffer.Buffer;
import io.vertx.core.file.AsyncFile;
import io.vertx.core.http.*;
import io.vertx.core.net.ProxyOptions;
import io.vertx.core.net.ProxyType;
import io.vertx.core.streams.Pump;
/**
@@ -700,8 +702,20 @@ public class HTTPExamples {
public void example58(Vertx vertx) {
HttpClientOptions options = new HttpClientOptions().setProxyHost("localhost").setProxyPort(3128);
options.setProxyUsername("username").setProxyPassword("secret");
HttpClientOptions options = new HttpClientOptions()
.setProxyOptions(new ProxyOptions().setProxyType(ProxyType.HTTP)
.setProxyHost("localhost").setProxyPort(3128)
.setProxyUsername("username").setProxyPassword("secret"));
HttpClient client = vertx.createHttpClient(options);
}
public void example59(Vertx vertx) {
HttpClientOptions options = new HttpClientOptions()
.setProxyOptions(new ProxyOptions().setProxyType(ProxyType.SOCKS5)
.setProxyHost("localhost").setProxyPort(1080)
.setProxyUsername("username").setProxyPassword("secret"));
HttpClient client = vertx.createHttpClient(options);
}