liris/websocket-client — pull request #94 by cjhanks (2014-07-04 22:35:05+00:00)
Title: Fix address resolution for cases where first result is not useful.

The socket connection logic always presumed the first returned result from
socket.getaddrinfo(...) is the target. However it is not uncommon to be
listening IPv4 while ignore IPv6. This code iterates through the return list
until one connects without a CONNECTION REFUSED error, if all fail, the
exception is rethrown. `man getaddrinfo` demonstrates a similar use pattern
in C.