I am currently working on a varnish-based project ..
we write vcl and vmod . But the project must check the body of the request. How can I get message request body in vcl or vmod using C function ?
vcl
vmod
C function
You can do almost anything you want with VCL / VMOD. You should try calling the VMOD routine in vcl_recv , and then write something like below in the C code:
vcl_recv
VRT_GetHdr(rec->s, HDR_REQ, "\017Content-Length:");
HTC_Read(rec->s->htc, body, bodylen);
And enjoy it!
You should take a look at existing vmods https://www.varnish-cache.org/vmods and you can freely search for the varnish API sources.
I'm not sure you can.
Lac usually only deals with Req / Resp headers. Bodies are transmitted without (significant) modification.
I will find a solution, please let me know how this interests me.
Source: https://habr.com/ru/post/1380728/More articles:How can I stop the default date displayed in MVC3 when it is not set? - asp.net-mvcJava Number / Maths Abstraction - javaWhy does sleep (), after acquiring pthread_mutex_lock, block the entire program? - linuxbest algorithm for checking 5 in a / col row in a matrix - pythonCalling a virtual member function from a base class (template) - c ++Choosing SQL with unique identifiers - sqlJava exception pointer exception - javaAvoiding using JavaScript with CSS attribute selector - javascriptHow to profile Monotouch to see the number of trampolines (by type) created at runtime? - genericsOrder Events Eventbus - eventsAll Articles