mirror of
https://github.com/jlengrand/vert.x.git
synced 2026-03-23 00:41:22 +00:00
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:
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user