Skip to content

Instantly share code, notes, and snippets.

@gkres
gkres / gist:5170799
Last active December 15, 2015 00:09
Libevent http server that acts like a middle man between a client and http server. (A quick example, just to try and clear a few libevent related things up. Pretty sure it could have been done better.)
#include <iostream>
#include <event.h>
#include <evhttp.h>
#include <event2/event.h>
#include <event2/http.h>
#include <event2/buffer.h>
#include <sys/queue.h>
#include <cstdlib>
@gkres
gkres / ipv6test.cc
Created February 14, 2013 13:07
Simple program to get data using HTTP.
#include <iostream>
#include <cstdlib>
#include <event.h>
#include <evhttp.h>
#include <event2/dns.h>
#include <event2/event.h>
using namespace std;
#include <iostream>
#include <map>
#include <ev.h>
#include <evhttpclient.h>
using namespace std;
void response_cb(ResponseInfo *response, void *requestData, void *clientData)
{
if(response == NULL)