8000 GitHub - reffone/libvmod-curl: cURL Varnish bindings by Varnish Software
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

reffone/libvmod-curl

8000
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Travis CI badge

This vmod provides cURL bindings for Varnish so you can use Varnish as an HTTP client and fetch headers and bodies from backends.

WARNING: Using vmod-curl to connect to HTTPS sites is currently unsupported and may lead to segmentation faults on VCL load/unload. (openssl library intricacies)

INSTALLATION

The source tree is based on autotools to configure the building, and does also have the necessary bits in place to do functional unit tests using the varnishtest tool.

If you have installed Varnish to a non-standard directory, call autogen.sh and configure with PKG_CONFIG_PATH pointing to the 5B6C appropriate path. For instance, when varnishd configure was called with --prefix=$PREFIX, use

PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
export PKG_CONFIG_PATH

Make targets:

  • make - builds the vmod
  • make install - installs your vmod in VMODDIR
  • make check - runs the unit tests in src/tests/*.vtc

To use the vmod do something along the lines of:

import curl;

sub vcl_recv {
        curl.get("http://example.com/test");
        if (curl.header("X-Foo") == "bar") {
        ...
        }

        curl.free();
}

See src/vmod_curl.vcc for the rest of the callable functions.

Development of this VMOD has been sponsored by the Norwegian company Aspiro Music AS for usage on their WiMP music streaming service.

About

cURL Varnish bindings by Varnish Software

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 72.2%
  • M4 12.8%
  • Makefile 8.3%
  • Shell 6.7%
0