I have removed index.html and if I go to appid.appspot.com:80 directly in the browser, i can see the header information printed out.
I think use can't set proxy with a request uri as /proxy. Richard On Sep 11, 5:38 am, "Jason (Google)" <apija...@google.com> wrote: > What do you see when you go to appid.appspot.com:80 directly in the browser? > Do you see the header information printed out or do you see a static file > like index.html? > > If you change the URL pattern, say /proxy instead of / > (i.e.http://appid.appsot.com:80/proxy), does it work? > > - Jason > > On Wed, Sep 9, 2009 at 6:49 AM, flyerhzm <flyer...@gmail.com> wrote: > > > I am going to write a proxy in GAE. I wrote a very simple test servlet > > to read http header. > > > public class RichardProxyServlet extends HttpServlet { > > public void doGet(HttpServletRequest req, HttpServletResponse resp) > > throws IOException { > > StringBuilder builder = new StringBuilder(); > > Enumeration e = req.getHeaderNames(); > > while (e.hasMoreElements()) { > > String headerName = (String) e.nextElement(); > > builder.append(headerName ).append(": > > ").append(req.getHeader > > (headerName)).append("\n"); > > } > > resp.setContentType("text/plain"); > > resp.getWriter().println("Hello, world"); > > resp.getWriter().println(req.getRequestURI()); > > resp.getWriter().println(builder.toString()); > > } > > } > > > and dispatch route '/' to this Servlet > > > <servlet> > > <servlet-name>RichardProxy</servlet-name> > > > <servlet-class>com.huangzhimin.proxy.RichardProxyServlet</servlet- > > class> > > </servlet> > > <servlet-mapping> > > <servlet-name>RichardProxy</servlet-name> > > <url-pattern>/</url-pattern> > > </servlet-mapping> > > > It works very in localhost, but after deploying to GAE and set proxy > > to appid.appspot.com:80, any url page will be redirect to google home > > page. Does anyone know why? Is it possible to write a proxy using > > servlet in GAE? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~----------~----~----~----~------~----~------~--~---