Skip to content

Commit

Permalink
fix docs for custom servlets
Browse files Browse the repository at this point in the history
  • Loading branch information
tipsy committed Feb 12, 2024
1 parent 7884099 commit ef183cb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pages/docs/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1835,11 +1835,11 @@ You can also use it to build simple proxy using `AsyncProxyServlet` that is part
```java
// Add org.eclipse.jetty:jetty-proxy to maven/gradle dependencies (e.g Javalin 5.3.2 uses Jetty 11.0.13)
Javalin.create(config -> {
config.jetty.contextHandlerConfig(sch -> {
ServletHolder proxyServlet = new ServletHolder(AsyncProxyServlet.Transparent.class);
proxyServlet.setInitParameter("proxyTo", "https://javalin.io/");
proxyServlet.setInitParameter("prefix", "/proxy");
sch.addServlet(proxyServlet, "/proxy/*");
config.jetty.modifyServletContextHandler { handler ->
ServletHolder proxyServlet = new ServletHolder(AsyncProxyServlet.Transparent.class);
proxyServlet.setInitParameter("proxyTo", "https://javalin.io/");
proxyServlet.setInitParameter("prefix", "/proxy");
handler.addServlet(proxyServlet, "/proxy/*");
});
}).start(7000);
```
Expand Down

0 comments on commit ef183cb

Please sign in to comment.