Android Question Detect if your are connected to a proxy


B4X founder
Staff member
Licensed User
Longtime User
This class is not relevant.

Try this:
Dim ProxySelector As JavaObject
ProxySelector = ProxySelector.InitializeStatic("").RunMethod("getDefault", Null)
Dim uri As JavaObject
uri = uri.InitializeStatic("").RunMethod("create", Array(""))
Dim list As List = ProxySelector.RunMethod("select", Array(uri))
If list.IsInitialized And list.Size > 0 Then
   Dim proxy As String = list.Get(0)
   Log(proxy) 'DIRECT, HTTP or SOCKS
End If
Upvote 0