Closed skoya closed 3 weeks ago
4.5.10
I encountered an exception which looks suspicious while .
I setup OAuth2 and then tried to proxy. Everything looks okay but then the proxied request failed after a time out. Commenting out all the OAuth2 code and it works fine as a reverse proxy.
v = Vertx.vertx(); HttpClient proxyClient = v.createHttpClient(); HttpProxy httpProxy = HttpProxy.reverseProxy(proxyClient); Router proxyRouter = Router.router(v); HttpServer proxyServer = v.createHttpServer(); OAuth2Auth authProvider = AzureADAuth.create(v, "CLIENT_ID", "CLIENT_SECRET", "TENANT"); OAuth2AuthHandler oauth2 = OAuth2AuthHandler.create(v, authProvider, "http://localhost:8201/callback/"); oauth2.setupCallback(proxyRouter.route("/callback/")); proxyRouter.route().handler(ctx -> { System.out.println("Global handler: Request path = " + ctx.request().path()); ctx.next(); // Pass request to the next handler in the chain }); proxyRouter.route("/*").handler(oauth2); proxyRouter.route("/*").handler(ctx-> { if (ctx.user() == null) { System.out.println("OAuth2 Auth handler triggered for path: " + ctx.request().path()); oauth2.handle(ctx); } else { System.out.println("User authenticated: " + ctx.user().principal()); ctx.next(); } }); proxyRouter.route(HttpMethod.GET, "/*").handler(ProxyHandler.create(httpProxy, 8200, "localhost")); proxyServer.requestHandler(proxyRouter).listen(8201);
I am using Windows 11 H2. Not sure if there is any weirdness with DNS.
Duplicates https://github.com/eclipse-vertx/vertx-http-proxy/issues/101
Questions
Version
4.5.10
Context
I encountered an exception which looks suspicious while .
I setup OAuth2 and then tried to proxy. Everything looks okay but then the proxied request failed after a time out. Commenting out all the OAuth2 code and it works fine as a reverse proxy.
Do you have a reproducer?
Steps to reproduce
Extra
I am using Windows 11 H2. Not sure if there is any weirdness with DNS.