C API for http://ipify.org
C Makefile
Latest commit 3b4ca02 May 1, 2016 @troglobit Bump version for v0.3 release
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Permalink
Failed to load latest commit information.
.gitignore
LICENSE
Makefile
README.md
ipify.c
ipify.h
testit.c

README.md

C library for api.ipify.org

lipify connects to http://ipify.org to query your current IP address. It supports both IPv4 and IPv6 addresses.

Example

Either get a descriptor, to use with poll() or an event loop library, like libuEv

    #include <ipify.h>

    int main(void)
    {
            int sd;
            char addr[256];

            sd = ipify_connect();
            if (sd < 0)
                    return 1;

            if (!ipify_query(sd, addr, sizeof(addr)))
                    printf("%s\n", addr);

            return ipify_disconnect(sd);
    }

or simply

    #include <ipify.h>

    int main(void)
    {
            char addr[256];

            if (ipify(addr, sizeof(addr)))
                    return 1;

            printf("%s\n", addr);
            return 0;
    }

License

lipify is free software, licensed to you under the very permissive ISC license. See the file LICENSE in the lipify distribution for details.

Origin & References

lipify is written by Joachim Nilsson, post bug reports and pull requests to the project's GitHub repository at https://github.com/troglobit/lipify