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 <[email protected]> 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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to