@Override public void start() throws Exception { HttpServer server = vertx.createHttpServer(new HttpServerOptions(). setUseAlpn(true). setSsl(true). setPemKeyCertOptions(new PemKeyCertOptions().setKeyPath("server-key.pem").setCertPath("server-cert.pem") )); server.requestHandler(req -> { HttpServerResponse resp = req.response(); req.customFrameHandler(frame -> { System.out.println("Received client frame " + frame.payload().toString("UTF-8")); // Write the sam resp.writeCustomFrame(10, 0, Buffer.buffer("pong")); }); }).listen(8443); } }
@Override public HttpServerRequest customFrameHandler(Handler<HttpFrame> handler) { delegate.customFrameHandler(handler); return this; }
Buffer expectedRecv = TestUtils.randomBuffer(500); server.requestHandler(req -> { req.customFrameHandler(frame -> { assertEquals(10, frame.type()); assertEquals(253, frame.flags());
@Override public HttpServerRequest customFrameHandler(Handler<HttpFrame> handler) { request.customFrameHandler(handler); return this; }
@Override public HttpServerRequest customFrameHandler(Handler<HttpFrame> handler) { delegate.customFrameHandler(handler); return this; }
/** * Set a custom frame handler. The handler will get notified when the http stream receives an custom HTTP/2 * frame. HTTP/2 permits extension of the protocol. * @param handler * @return a reference to this, so the API can be used fluently */ public io.vertx.rxjava.core.http.HttpServerRequest customFrameHandler(Handler<io.vertx.rxjava.core.http.HttpFrame> handler) { delegate.customFrameHandler(new Handler<io.vertx.core.http.HttpFrame>() { public void handle(io.vertx.core.http.HttpFrame event) { handler.handle(io.vertx.rxjava.core.http.HttpFrame.newInstance(event)); } }); return this; }
/** * Set a custom frame handler. The handler will get notified when the http stream receives an custom HTTP/2 * frame. HTTP/2 permits extension of the protocol. * @param handler * @return a reference to this, so the API can be used fluently */ public io.vertx.rxjava.core.http.HttpServerRequest customFrameHandler(Handler<io.vertx.rxjava.core.http.HttpFrame> handler) { delegate.customFrameHandler(new Handler<io.vertx.core.http.HttpFrame>() { public void handle(io.vertx.core.http.HttpFrame event) { handler.handle(io.vertx.rxjava.core.http.HttpFrame.newInstance(event)); } }); return this; }
Buffer expectedRecv = TestUtils.randomBuffer(500); server.requestHandler(req -> { req.customFrameHandler(frame -> { assertEquals(10, frame.type()); assertEquals(253, frame.flags());