APISonar


io.vertx.core.net.ProxyType.HTTP

> io > vertx > core > net > ProxyType > HTTP
io APIs vertx APIs core APIs net APIs ProxyType APIs HTTP APIs

Example 1
protected void startProxy(String username, ProxyType proxyType) throws Exception {
    if (proxyType == ProxyType.HTTP) {
      proxy = new HttpProxy(username);
    } else {
      proxy = new SocksProxy(username);
    }
    proxy.start(vertx);
  }
Example 2
public void example58(Vertx vertx) {

    HttpClientOptions options = new HttpClientOptions()
        .setProxyOptions(new ProxyOptions().setType(ProxyType.HTTP)
            .setHost("localhost").setPort(3128)
            .setUsername("username").setPassword("secret"));
    HttpClient client = vertx.createHttpClient(options);

  }
Example 3
public void example60(Vertx vertx) {

    HttpClientOptions options = new HttpClientOptions()
        .setProxyOptions(new ProxyOptions().setType(ProxyType.HTTP));
    HttpClient client = vertx.createHttpClient(options);
    client.getAbs("ftp://ftp.gnu.org/gnu/", ar -> {
      if (ar.succeeded()) {
        HttpClientResponse response = ar.result();
        System.out.println("Received response with status code " + response.statusCode());
      }
    });

  }