Package org.vertx.java.core.http

Examples of org.vertx.java.core.http.HttpClient.request()


    final HttpClient client = vertx.createHttpClient().setHost("localhost").setPort(8282);

    vertx.createHttpServer().requestHandler(new Handler<HttpServerRequest>() {
      public void handle(final HttpServerRequest req) {
        System.out.println("Proxying request: " + req.uri());
        final HttpClientRequest cReq = client.request(req.method(), req.uri(), new Handler<HttpClientResponse>() {
          public void handle(HttpClientResponse cRes) {
            System.out.println("Proxying response: " + cRes.statusCode());
            req.response().setStatusCode(cRes.statusCode());
            req.response().headers().set(cRes.headers());
            req.response().setChunked(true);
View Full Code Here


    final HttpClient client = vertx.createHttpClient().setHost("localhost").setPort(8282);

    vertx.createHttpServer().requestHandler(new Handler<HttpServerRequest>() {
      public void handle(final HttpServerRequest req) {
        System.out.println("Proxying request: " + req.uri);
        final HttpClientRequest cReq = client.request(req.method, req.uri, new Handler<HttpClientResponse>() {
          public void handle(HttpClientResponse cRes) {
            System.out.println("Proxying response: " + cRes.statusCode);
            req.response.statusCode = cRes.statusCode;
            req.response.headers().putAll(cRes.headers());
            req.response.setChunked(true);
View Full Code Here

        if (secure) {
            client.setSSL(true);
        }
       
        final HttpClientRequest cReq = client.request(req.method(), newUri, new Handler<HttpClientResponse>() {
          public void handle(HttpClientResponse cRes) {
            req.response().setStatusCode(cRes.statusCode());
            req.response().headers().set(cRes.headers());
            req.response().setChunked(true);
            cRes.dataHandler(new Handler<Buffer>() {
View Full Code Here

    final HttpClient client = vertx.createHttpClient().setHost("localhost").setPort(8282);

    vertx.createHttpServer().requestHandler(new Handler<HttpServerRequest>() {
      public void handle(final HttpServerRequest req) {
        System.out.println("Proxying request: " + req.uri);
        final HttpClientRequest cReq = client.request(req.method, req.uri, new Handler<HttpClientResponse>() {
          public void handle(HttpClientResponse cRes) {
            System.out.println("Proxying response: " + cRes.statusCode);
            req.response.statusCode = cRes.statusCode;
            req.response.headers().putAll(cRes.headers());
            req.response.setChunked(true);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.