/ Published in: Java
URL: http://bcmoney-mobiletv.com/blog/2009/05/01/the-server-side-proxy/
Source of inspiration was the Proxy deployed as part of GeoDashViewer: http://trac2.assembla.com/alegia/browser/GeoDashViewer/WebContent/proxy.jsp?rev=341
As well as the idea from: http://vsingleton.blogspot.com/2006/12/simple-jsp-soap-proxy.html
After posting, saw something very similar blogged about here: https://www.codemagi.com/blog/post/190
And here: http://rrao.host.adobe.com/kannan/JSPProxyScript.jsp.txt
Expand |
Embed | Plain Text
<%@page session="false"%> <%@page import="java.net.*,java.io.*" %> <% try { con.setDoOutput(true); con.setRequestMethod(request.getMethod()); int clength = request.getContentLength(); if(clength > 0) { con.setDoInput(true); byte[] idata = new byte[clength]; request.getInputStream().read(idata, 0, clength); con.getOutputStream().write(idata, 0, clength); } response.setContentType(con.getContentType()); String line; while ((line = rd.readLine()) != null) { out.println(line); } rd.close(); response.setStatus(500); } %>
You need to login to post a comment.
