Skip to content

Commit 855d789

Browse files
committed
Don't include IPv4 or Docker addresses in connection config sent via ADB
This fixes a bug where devices would connect via IPv6, which isn't actually supported. This worked with QR codes (because the UI does correctly do this filtering) but not with ADB because of this issue. It also reduces unnecessary network checks (and waiting for timeouts, potentially) for some cases too.
1 parent 4bc2dbe commit 855d789

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/interceptors/android/android-adb-interceptor.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,15 @@ export class AndroidAdbInterceptor implements Interceptor {
103103
'10.0.3.2', // Genymotion localhost ip
104104
].concat(
105105
// Every other external network ip
106-
_.flatMap(os.networkInterfaces(), (addresses) =>
106+
_.flatMap(os.networkInterfaces(), (addresses, iface) =>
107107
(addresses || [])
108-
.filter(a => !a.internal)
108+
.filter(a =>
109+
!a.internal && // Loopback interfaces
110+
a.family === "IPv4" && // Android VPN app supports IPv4 only
111+
iface !== 'docker0' && // Docker default bridge interface
112+
!iface.startsWith('br-') && // More docker bridge interfaces
113+
!iface.startsWith('veth') // Virtual interfaces for each docker container
114+
)
109115
.map(a => a.address)
110116
)
111117
),

0 commit comments

Comments
 (0)