Add IPv6 support to create_websocket()

The current implementation is hardcoded to use AF_INET, which means
IPv4. We need to be able to support IPv6 connections, too, so we use the
socket.getaddrinfo() function as described in [1] in order to provide a
more generic solution.

[1] https://docs.python.org/2/library/socket.html

Change-Id: I2ccbe3b25e79031a3c961871034c0c1b94d7ee80
Closes-Bug: 1719575
Related-Bug: 1656329
1 file changed