You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by Davi Loperz <at...@gmail.com> on 2012/10/17 01:00:32 UTC

Get URL

Hy,

I'm developing a plugin in which they need, when accessing certain
URL, it makes a second request to a specific URL and process the
contents of this URL.
What would be the best option?
Using libcurl or there is some internal function that can be used?

Virtual Word Network Company

Re: Get URL

Posted by James Peach <jp...@apache.org>.
On 16/10/2012, at 5:51 PM, Davi Loperz <at...@gmail.com> wrote:

> More questions arise.
> Can I call the function within TSFetchURL TSPluginInit to get some
> items (content common to all requests) needed for other requests?

In general this should work fine, but remember that at this time not all the plugins have been loaded. You might get subsequent plugins loaded that change the behaviour.

The initialization order is subject to change. In a future release, we aim to have well-defined event hooks that plugins can use to take action as different points in the ATS lifecycle, see https://issues.apache.org/jira/browse/TS-1487.

> Or do I have to call from an event created by TSHttpHookAdd?
> 
> Virtual Word Network Company


Re: Get URL

Posted by Davi Loperz <at...@gmail.com>.
More questions arise.
Can I call the function within TSFetchURL TSPluginInit to get some
items (content common to all requests) needed for other requests?
Or do I have to call from an event created by TSHttpHookAdd?

Virtual Word Network Company

Re: Get URL

Posted by Davi Loperz <at...@gmail.com>.
Thank you.

I'll start my tests right now.

Virtual Word Network Company

Re: Get URL

Posted by Brian Geffon <br...@apache.org>.
If you specify a https url it should use ssl. TSFetchUrl just takes a
raw request, so you would do something like:

std::string request = "GET https://www.google.com HTTP/1.0\r\nCookie:
foo=bar\r\n\r\n";

Brian

On Tue, Oct 16, 2012 at 4:54 PM, Davi Loperz <at...@gmail.com> wrote:
> One more question.
> This feature supports encryption?
>
> Virtual Word Network Company

Re: Get URL

Posted by Davi Loperz <at...@gmail.com>.
One more question.
This feature supports encryption?

Virtual Word Network Company

Re: Get URL

Posted by Brian Geffon <br...@apache.org>.
TSFetchURL makes that pretty easy, alternatively, you can use
TSHttpConnect, but TSFetchURL is just a wrapper around that anyway.

Brian

On Tue, Oct 16, 2012 at 4:00 PM, Davi Loperz <at...@gmail.com> wrote:
> Hy,
>
> I'm developing a plugin in which they need, when accessing certain
> URL, it makes a second request to a specific URL and process the
> contents of this URL.
> What would be the best option?
> Using libcurl or there is some internal function that can be used?
>
> Virtual Word Network Company