Closed as not planned
Description
Questions
if i add a BodyHandler before proxyRouter ,it can not get anything but wait always
the origin server is :
Vertx vertx = Vertx.vertx();
HttpServer backendServer = vertx.createHttpServer();
Router backendRouter = Router.router(vertx);
backendRouter.route(HttpMethod.GET, "/foo2").handler(rc -> {
rc.response()
.putHeader("content-type", "text/html")
.end("<html><body><h1>I'm the target resource!</h1></body></html>");
});
backendServer.requestHandler(backendRouter).listen(7070);
the proxy server is :
Vertx vertx = Vertx.vertx();
HttpServer proxyServer = vertx.createHttpServer();
Router proxyRouter = Router.router(vertx);
proxyRouter.route().handler(SessionHandler.create(LocalSessionStore.create(vertx)));
proxyRouter.route().handler(BodyHandler.create());
proxyRouter.route("/upload/*").handler(ResourceHandler.create("upload"));
proxyServer.requestHandler(proxyRouter);
HttpClient proxyClient = vertx.createHttpClient();
proxyRouter.route(HttpMethod.GET, "/foo").handler(context->{
ProxyRequest proxyRequest = ProxyRequest.reverseProxy(context.request());
proxyRequest.setURI("/foo2");
proxyClient.request(proxyRequest.getMethod(), 7070, "localhost", "foo2").compose(proxyRequest::send)
.onSuccess(x -> {
x.send();
})
.onFailure(err -> {
err.printStackTrace();
proxyRequest.release();
});
});
proxyServer.listen(8089);
if i remove the BodyHandler it can proxy correct
Version
vertx version :4.1.5
OS version: Win10
JVM version:1.8