Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
CTF
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grzegorz
CTF
Commits
5bd61661
Commit
5bd61661
authored
Apr 12, 2016
by
Grzegorz Pietrusza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
not working stub
parent
cd7ba07b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
pom.xml
service/pom.xml
+16
-0
CTFApplication.java
.../java/com/telephoners/krakyournet/ctf/CTFApplication.java
+12
-0
No files found.
service/pom.xml
View file @
5bd61661
...
...
@@ -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>
...
...
service/src/main/java/com/telephoners/krakyournet/ctf/CTFApplication.java
View file @
5bd61661
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment