Skip to content

Commit

Permalink
Merge pull request #700 from funfoolsuzi/master
Browse files Browse the repository at this point in the history
stetho_open connect also consider IPv6
  • Loading branch information
Josh Guilfoyle authored Apr 7, 2021
2 parents 909b930 + eb8649c commit 7c4dc8d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/stetho_open.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ def __init__(self):

def connect(self, port=5037):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(('127.0.0.1', port))
try:
sock.connect(('localhost', port))
except ConnectionRefusedError:
sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
sock.connect(('localhost', port))
self.sock = sock

def select_service(self, service):
Expand Down

0 comments on commit 7c4dc8d

Please sign in to comment.