trafficserver-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Peach <jpe...@apache.org>
Subject Re: Dynamic HTML messages sent to client
Date Thu, 30 May 2013 15:29:32 GMT
On May 29, 2013, at 2:39 AM, Stas Obydionnov <stasik.ob@gmail.com> wrote:

> Hi all,
> We are implementing product which requires to display different HTML messages to different
users.
> I know there are customisable pages like described here http://trafficserver.apache.org/docs/trunk/admin/traffic-server-error-messages/index.en.html#HTMLMessagesSentClients.
And I know there is a possibility to define different file per language.
> What I need is something different. I need an option to select the page according to
transaction information available in plugin.
> For example, if request comes particular IP I send one error page, if from another IP,
I send another page.

You probably want:

  tsapi void TSHttpTxnErrorBodySet(TSHttpTxn txnp, char* buf, int buflength, char* mimetype);

There's also:

  tsapi void TSHttpTxnSetHttpRetBody(TSHttpTxn txnp, const char* body_msg, int plain_msg);

At one point I played with these and I recall that they worked from a remap plugin, but not
from the hook I was calling them in my global plugin. Let us know how you go and we can fix
up any issues you run into.


> If there is a hook which I can hook and provide the ATS the page I want to be sent to
client, it will be good solution. Even if I would have ability to redirect the client to the
server which will display the error message it would be good.
> 
> Thank you.
> Stas.


Mime
View raw message