You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Chris Shenton <Ch...@hq.nasa.gov> on 2002/01/22 22:43:20 UTC

Turbine (with auth/session) as transparent proxy (no templates)?

I'm working on a proxy, which after auth and session establishment,
will retrieve URLs entered in a form (possibly rewrite URLs in html
content) and deliver the content back to the requesting user.  So I'd
like to use Turbine's user model and session tracking facilities. But
I want to be able to output content to the user without the typical
Turbine templates. It needs to be able to do this for textual and
binary data (e.g., images, applet jars).

Currently, my proxy retrieves the requested content from the remote
server and delivers it back to the requestor as a context variable
inside a template. I've created empty Layout and Screen templates, but
Turbine still emits its own BODY and other tags, which confuse the
browser because the proxied content has its own BODY tags and such.

I also want to be able to pass through HTTP headers give me by the
target server, so I can pass them back to the client unchanged:
cookies, content types, expiration metadata, etc.  So basically I want
a transparent proxy -- bypassing page-generation code -- which
preserves request headers, and response headers and content.  But I
want to offer this only to logged-in users and track sessions, like I
normally do.

RunData has some methods that sound like they might do the right
thing, but I can't tell from the JavaDoc nor the code what they
really do:

* declareDirectResponse()
  Declares that output will be direct to the response stream, even
  though getOut() may never be called.

* getOut()
  Gets the print writer.


I could go low-level servlet, with methods hanging off
RunData.getResponse().* -- the javax.servlet.http calls like
getOutputStream() and getWriter().  The former claims to be able to
send binary data, while the latter appears to only be able to send
character text.  I need to be able to act like a web server to my
client and send back binary data like image/jpeg; so must I use
getOutputStream()?

Whichever mechanism I use I need to be able to use Turbine's auth and
session tracking, whether its using cookies or URL-rewriting -- I need
to support both forms of tracking.  It would be preferable if I didn't
have to write my own cookie-handling stuff, setting the right cookie
header, or rewriting URLs in stuff I hand back.

Any suggestions?  Thanks!


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>