benbjohnson/go-raft — pull request #63 by benbjohnson (2013-07-09 03:08:54+00:00)
Title: Default HTTP Transporter

@xiangli-cmu I added a default HTTP transporter implementation. It's heavily influenced by @peterbourgon's HTTP transporter because he did an awesome job with his. I added in prefixing and an option for turning off keep-alive since it's problematic for testing.

I also added a test harness for it. The `runTestHttpServers()` function starts up one Raft server + HTTP server for each anonymous function passed into it. Each anonymous function gets called simultaneously so they can adjust and verify their state at different points in time (based of the heartbeat and election timeouts).

The current test just kills the leader server and waits to verify that one of the other two servers picks up leadership. Nothing too fancy but it verifies AE & RV paths.