Commit 5bd61661 authored by Grzegorz Pietrusza's avatar Grzegorz Pietrusza

not working stub

parent cd7ba07b
......@@ -143,6 +143,22 @@
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-jetty</artifactId>
<version>0.9.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-proxy</artifactId>
<version>9.3.9.M0</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.aggregate</groupId>
<artifactId>jetty-all</artifactId>
<version>9.1.5.v20140505</version>
</dependency>
<dependency>
<groupId>com.bazaarvoice.dropwizard</groupId>
<artifactId>dropwizard-webjars-bundle</artifactId>
<version>0.2.1</version>
......
......@@ -22,8 +22,10 @@ import io.dropwizard.auth.basic.BasicCredentialAuthFilter;
import io.dropwizard.jersey.setup.JerseyEnvironment;
import io.dropwizard.setup.Bootstrap;
import io.dropwizard.setup.Environment;
import org.eclipse.jetty.proxy.ProxyServlet;
import org.glassfish.jersey.server.filter.RolesAllowedDynamicFeature;
import javax.servlet.ServletRegistration;
import java.io.IOException;
import java.util.stream.Stream;
......@@ -75,6 +77,16 @@ public class CTFApplication extends Application<ApplicationConfiguration>
registerResources(environment);
registerAuthFeatures(environment);
registerFilters(environment);
ServletRegistration.Dynamic proxy = environment.servlets().addServlet("proxy", ProxyServlet.Transparent.class);
proxy.setInitParameter("ProxyTo","http://host1:8052/");
proxy.setInitParameter("Prefix", "/service1");
// final String proxyPrefix = "/proxy";
// final String proxyTo = "http://www.google.com/";
// ServletHolder proxyServlet = new ServletHolder(ProxyServlet.Transparent.class);
// proxyServlet.setInitParameter("proxyTo", proxyTo);
// Servlet servlet = proxyServlet.getServlet();
// environment.servlets().addServlet("ProxyServlet", servlet).addMapping(proxyPrefix + "/*");
}
private void registerAdmins(ApplicationConfiguration applicationConfiguration)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment