resiprocate/resiprocate — pull request #2 by ngzhian (2013-05-15 02:33:44+00:00)
Title: Connectionbase

The first commit removes an entire portion of `wsProcessHandshake()` that
deals with an [deprecated protocol](http://www.whatwg.org/specs/web-socket-protocol/).
There is also a bit of refactoring. Scanning the message header is its
own function now. Making the handshake response is also its own
function, which handles instances when a header can not be found.

The second commit renames the the fake transport class (`FakeTransport` ->
`FakeTCPTransport`), and added a new `FakeWSTransport` class. This will
facilitate adding test cases.
The original test is moved into its own function, `testTCPConnection()`.
This will allow more tests, e.g. `testWsProcessHandshake()`, to be
added, and makes the main function cleaner and easier to understand.