Skip to content

Commit

Permalink
Bail early for IPv6
Browse files Browse the repository at this point in the history
  • Loading branch information
lvh committed Aug 6, 2015
1 parent 3cac06d commit 4081b79
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions socks.py
Expand Up @@ -625,6 +625,12 @@ def connect(self, dest_pair):
dest_pair - 2-tuple of (IP/hostname, port).
"""
if len(dest_pair) != 2:
# Probably IPv6, not supported -- raise an error, and hope
# Happy Eyeballs (RFC6555) makes sure at least the IPv4
# connection works...
raise socket.error("SocksPy doesn't support IPv6")

dest_addr, dest_port = dest_pair

if self.type == socket.SOCK_DGRAM:
Expand Down

0 comments on commit 4081b79

Please sign in to comment.