trafficserver-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Morilha <dmori...@gmail.com>
Subject Re: header_rewrite to modify destination port based on request header
Date Fri, 09 Oct 2015 16:55:30 GMT
Hi, after talking a quick look into header_rewrite source code, it looks
like it is just a matter of calling "expand" into the function which
validates and sets the port. If so, would the community be ok with such
addition? I really really would like to avoid the lua plugin only for this.
Thanks.
On Oct 8, 2015 6:53 AM, "Brian Geffon" <briang@apache.org> wrote:

> This will likely be discussed next month at the ATS summit in Sunnyvale,
> CA (please sign up and join if you can make it, details on the wiki).
> However, final discussions regarding things like this always take place on
> the mailing list.
>
> Brian
>
> On Thursday, October 8, 2015, LIN, SHU-CHIH <sl3241@att.com> wrote:
>
>> Hi:
>>
>>
>>
>> Any insight when Lua will be moved from "experimental" to “stable”? Lua
>> looks to offer great flexibility (in consolidating existing plugins and to
>> add new custom changes) so wonder what may stop one from using it to handle
>> Production traffic? Understood one would need to assess the performance
>> overheads it may incur.
>>
>>
>>
>> Thanks,
>>
>>
>>
>> Shu-Chih
>>
>>
>>
>> *From:* Scott Beardsley [mailto:sbeards@yahoo-inc.com]
>> *Sent:* Wednesday, October 07, 2015 7:28 PM
>> *To:* Jeremy Payne <jp557198@gmail.com>; users@trafficserver.apache.org
>> *Subject:* Re: header_rewrite to modify destination port based on
>> request header
>>
>>
>>
>> Thanks Jeremy, we we hoping to use an existing/stable plugin to do this
>> (lua appears to be "experimental" and we don't use it anywhere at the
>> moment). It seems like header_rewrite is 99% of the way there so if it
>> means adding this one feature we'd prefer that since it wouldn't involve
>> new config syntax and/or plugins.
>>
>>
>>
>> Scott
>>
>>
>>
>>
>>
>> On Wednesday, October 7, 2015 1:41 PM, Jeremy Payne <jp557198@gmail.com>
>> wrote:
>>
>>
>>
>> Not sure if you are just researching or what.. But this same
>> functionality is also supported in the lua plugin.
>>
>>
>> http://trafficserver.readthedocs.org/en/6.0.x/reference/plugins/ts_lua.en.html
>> ts.client_request.set_url_port
>>
>>
>>
>>
>>
>> On Wed, Oct 7, 2015 at 12:41 PM, Scott Beardsley <sbeards@yahoo-inc.com>
>> wrote:
>>
>> I'd like to modify the destination port based on an incoming request
>> header. It seems like everything I need is available in the header_rewrite
>> plugin except the value expansion in the "set-destination port" directive.
>> In the docs it says that this expansion only works for add-header[1].
>>
>>
>>
>> Is there a way to do something like the following via the existing
>> plugin, maybe my syntax is wrong?
>>
>>
>>
>> cond %{READ_REQUEST_HDR_HOOK} [AND]
>>
>> cond %{CLIENT-HEADER:NEW-PORT} /^[1-9][0-9]*$/
>>
>> set-destination PORT %{CLIENT-HEADER:NEW-PORT} [L]
>>
>>
>>
>> When I test it I get this debug message: "Would set destination PORT to
>> an invalid range, skipping"
>>
>>
>>
>> Which points me at this code[2]. It looks like the _value variable is set
>> to the string "%{CLIENT-HEADER:NEW-PORT}" so I guess there is no
>> expansion...
>>
>>
>>
>> Assuming header_rewrite doesn't support this yet, are there any
>> objections to adding this feature?
>>
>>
>>
>> Thanks,
>>
>> Scott
>>
>> --
>>
>> [1]
>> http://trafficserver.readthedocs.org/en/latest/reference/plugins/header_rewrite.en.html?highlight=header_rewrite#variable-expansion
>>
>> [2]
>> https://git-wip-us.apache.org/repos/asf?p=trafficserver.git;a=blob;f=plugins/header_rewrite/operators.cc;h=5ce75f5985e3e42374814e5a46c361e450bdd779;hb=HEAD#l228
>>
>>
>>
>>
>>
>

Mime
View raw message