Android Question Detect if your are connected to a proxy

Erel

Administrator
Staff member
Licensed User
This class is not relevant.

Try this:
B4X:
Dim ProxySelector As JavaObject
ProxySelector = ProxySelector.InitializeStatic("java.net.ProxySelector").RunMethod("getDefault", Null)
Dim uri As JavaObject
uri = uri.InitializeStatic("java.net.URI").RunMethod("create", Array("https://www.b4x.com"))
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
Top