This repository was archived by the owner on Dec 20, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- This is an example skeleton for developing out-of-tree Varnish vmods.
1+ This is an example skeleton for developing out-of-tree Varnish
2+ vmods. It implements the "Hello, World!" as a vmod callback. Not
3+ particular useful in good hello world tradition, but demonstrates how
4+ to get the glue around a vmod working.
5+
6+ The source tree is based on autotools to configure the building, and
7+ does also have the necessary bits in place to do functional unit tests
8+ using the varnishtest tool.
29
310Usage:
411./configure VARNISHSRC=DIR [VMODDIR=DIR]
@@ -11,4 +18,16 @@ Optionally you can also set the vmod install dir by adding VMODDIR=DIR
1118(defaults to the pkg-config discovered directory from your Varnish
1219installation).
1320
21+ Make targets:
22+ make - builds the vmod
23+ make install - installs your vmod in VMODDIR
24+ make check - runs the unit tests in src/tests/*.vtc
25+
26+ In your VCL you could then use this vmod along the following lines:
27+
28+ import example;
1429
30+ sub vcl_deliver {
31+ # This sets resp.http.hello to "Hello, World"
32+ set resp.http.hello = example.hello("World");
33+ }
You can’t perform that action at this time.
0 commit comments