-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathProxyServlet.java
More file actions
38 lines (29 loc) · 1.29 KB
/
ProxyServlet.java
File metadata and controls
38 lines (29 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package cz.tomucha.gae.proxy;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Enumeration;
/**
* Use this example to integrate {@Proxy} with your project.
*/
public class ProxyServlet extends javax.servlet.http.HttpServlet {
/**
* Don't forget to change this constant!
*/
public static String PROXY_TARGET = "https://github.com/";
private static Proxy proxy = new Proxy(PROXY_TARGET);
protected void doPost(HttpServletRequest clientRequest, HttpServletResponse proxyResponse) throws javax.servlet.ServletException, IOException {
proxy.doPost(clientRequest, proxyResponse);
}
protected void doGet(HttpServletRequest clientRequest, HttpServletResponse proxyResponse) throws javax.servlet.ServletException, IOException {
proxy.doGet(clientRequest, proxyResponse);
}
protected void doDelete(HttpServletRequest clientRequest, HttpServletResponse proxyResponse) throws javax.servlet.ServletException, IOException {
proxy.doDelete(clientRequest, proxyResponse);
}
protected void doPut(HttpServletRequest clientRequest, HttpServletResponse proxyResponse) throws javax.servlet.ServletException, IOException {
proxy.doPut(clientRequest, proxyResponse);
}
}