Skip to content

Latest commit

 

History

History
49 lines (32 loc) · 1.2 KB

README.md

File metadata and controls

49 lines (32 loc) · 1.2 KB

libhey does one thing, it connects sockets, and only stream sockets at that. But it does it using Happy Eyeballs and it's dead easy to use.

Functions

Example

int s = hey_connect(NULL, "www.google.com", "80", 10000);
char errbuf[256];

if (s < 0)
    errx(1, "hey_connect: %s", hey_strerror(s, errbuf, sizeof (errbuf)));

Compiling

libhey is built using cmake. To install in the default prefix /usr/local:

cmake .
make
sudo make install

You can change the prefix by adding -DCMAKE_INSTALL_PREFIX:

cmake -DCMAKE_INSTALL_PREFIX=/usr .

You can also replace cmake with ccmake to interactively edit flags.

For development/hacking, it's recommended that you use a separate build directory, and add the flag -DCMAKE_BUILD_TYPE=Debug:

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
make

License

libhey is distributed under the BSD 2-clause license, see the various source files for details.