You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by supraja sridhar <su...@gmail.com> on 2018/02/28 12:06:29 UTC

Proxy response after hooks in ATS

Hi,

Is there a way to look at the response after it is subjected to hooks in
ATS? I am running trafficserver in foreground with the -Thttp tag and I can
see OS request, Proxy request, Proxy request after hooks for requests but
only OS response and Proxy response for response. I have a plugin similar
to blacklist-0 and would like to if the response transform has taken place.

Thanks,
Supraja

Re: Proxy response after hooks in ATS

Posted by supraja sridhar <su...@gmail.com>.
Thank you ! From the logs it looks like the proxy response is dumped before
callback to the plugin.

Logs:
[Feb 28 12:16:24.833] Server {0x7f7dceee7700} DEBUG: <HttpSM.cc:1474
(state_api_callout)> (http) [79] calling plugin on hook
*TS_HTTP_READ_REQUEST_HDR_HOOK
*at hook 0x55af01a68fc0
[Feb 28 12:16:24.833] Server {0x7f7dceee7700} DEBUG: <HttpSM.cc:1358
(state_api_callback)> (http) [79] [&HttpSM::state_api_callback,
HTTP_API_ERROR]
[Feb 28 12:16:24.833] Server {0x7f7dceee7700} DEBUG: <HttpSM.cc:1398
(state_api_callout)> (http) [79] [&HttpSM::state_api_callout,
HTTP_API_ERROR]
[Feb 28 12:16:24.833] Server {0x7f7dceee7700} DEBUG: <HttpTransact.cc:1439
(HandleApiErrorJump)> (http_trans) [79] [HttpTransact::HandleApiErrorJump]
+++++++++ Proxy's Response 2 +++++++++
-- State Machine Id: 79
HTTP/1.1 500 INKApi Error^M
Date: Wed, 28 Feb 2018 12:16:24 GMT^M
Connection: close^M
^M
[Feb 28 12:16:24.833] Server {0x7f7dceee7700} DEBUG: <HttpTransact.cc:1472
(HandleApiErrorJump)> (http_trans) Next action
SM_ACTION_INTERNAL_CACHE_NOOP; nullptr
[Feb 28 12:16:24.833] Server {0x7f7dceee7700} DEBUG: <HttpSM.cc:7272
(call_transact_and_set_next_state)> (http) [79] State Transition:
SM_ACTION_API_READ_REQUEST_HDR -> SM_ACTION_INTERNAL_CACHE_NOOP
[Feb 28 12:16:24.833] Server {0x7f7dceee7700} DEBUG: <HttpSM.cc:1474
(state_api_callout)> (http) [79]* calling plugin on hook
TS_HTTP_SEND_RESPONSE_HDR_HOOK at hook 0x55af01a68ec0*



On Wed, Feb 28, 2018 at 10:40 PM, Alan Carroll <so...@oath.com>
wrote:

> Proxy response should be after most hooks, i.e. what is sent back to the
> user agent. If you really want to be sure, I'd use wireshark. If you are
> doing a transform, you will generally need wireshark to see the transformed
> content.
>
> On Wed, Feb 28, 2018 at 6:06 AM, supraja sridhar <
> suprajasridhar95@gmail.com> wrote:
>
>> Hi,
>>
>> Is there a way to look at the response after it is subjected to hooks in
>> ATS? I am running trafficserver in foreground with the -Thttp tag and I can
>> see OS request, Proxy request, Proxy request after hooks for requests but
>> only OS response and Proxy response for response. I have a plugin similar
>> to blacklist-0 and would like to if the response transform has taken place.
>>
>> Thanks,
>> Supraja
>>
>
>

Re: Proxy response after hooks in ATS

Posted by Alan Carroll <so...@oath.com>.
Proxy response should be after most hooks, i.e. what is sent back to the
user agent. If you really want to be sure, I'd use wireshark. If you are
doing a transform, you will generally need wireshark to see the transformed
content.

On Wed, Feb 28, 2018 at 6:06 AM, supraja sridhar <suprajasridhar95@gmail.com
> wrote:

> Hi,
>
> Is there a way to look at the response after it is subjected to hooks in
> ATS? I am running trafficserver in foreground with the -Thttp tag and I can
> see OS request, Proxy request, Proxy request after hooks for requests but
> only OS response and Proxy response for response. I have a plugin similar
> to blacklist-0 and would like to if the response transform has taken place.
>
> Thanks,
> Supraja
>