3 ms·
Apache Traffic Server has support for native C++ plugins which allow you to make transformations to the headers and the body as the request and response passes
by therein 11y ago
Apache Traffic Server has support for native C++ plugins which allow you to make transformations to the headers and the body as the request and response passes through it. ATS's power comes mainly from these plugins, I would say, rather than just a reverse caching proxy.
https://github.com/apache/trafficserver/tree/master/lib/atscppapi https://github.com/apache/trafficserver/tree/master/lib/atsc...
You can do stuff like:
> registerHook(HOOK_READ_REQUEST_HEADERS_PRE_REMAP);
> registerHook(HOOK_READ_REQUEST_HEADERS_POST_REMAP);
> registerHook(HOOK_SEND_REQUEST_HEADERS);
> if (transaction.getClientRequest().getUrl().getQuery().find("redirect=1") != string::npos) {
> cout << "Sending this guy to google." << endl;
> transaction.getClientResponse().getHeaders().append("Location", "http://www.google.com");
> transaction.getClientResponse().setStatusCode(HTTP_STATUS_MOVED_TEMPORARILY);
> transaction.getClientResponse().setReasonPhrase("Come Back Later");
> }
> transaction.resume();
- voltagex_ 11y agoHuh. You could conceivably replace ISA/TMG (Microsoft Forefront) with ATS. There are still places using those products as load balancers / reverse proxies even though support is almost completely gone.