Hi all,
I'm trying to deploy one of my sw in a very strictly controlled LAN where everything should pass through a proxy.
They ask me to integrate the ability to make use of their proxy in my sw.
What should I do?
As an example of data transmission, I have:
wscsync is:
Public const wscsync As String = "https://<mydomain>:62238/mnog"
Proxy needs authentication (user/password). What they can give me is:
proxy name/address
proxy port
proxy user (allowed to access Internet)
proxy password for user
I found the following code snippets on this forum, but I don't know how to use them (and whether they could be part of the solution):
Please, note the use of HTTPS (original code was for HTTP).
TIA
I'm trying to deploy one of my sw in a very strictly controlled LAN where everything should pass through a proxy.
They ask me to integrate the ability to make use of their proxy in my sw.
What should I do?
As an example of data transmission, I have:
B4X:
Dim pJob As HttpJob
pJob.Initialize("", Me)
pJob.PostBytes(wscsync, buffer)
Wait For (pJob) JobDone(j As HttpJob)
wscsync is:
Public const wscsync As String = "https://<mydomain>:62238/mnog"
Proxy needs authentication (user/password). What they can give me is:
proxy name/address
proxy port
proxy user (allowed to access Internet)
proxy password for user
I found the following code snippets on this forum, but I don't know how to use them (and whether they could be part of the solution):
B4X:
SetSystemProperty("http.proxyHost","webwasher.xxxx.com")
SetSystemProperty("https.proxyHost", "webwasher.xxx.com")
SetSystemProperty("http.proxyPort", 3128)
SetSystemProperty("https.proxyPort", 3128)
SetSystemProperty("https.proxyUser", <username>)
SetSystemProperty("https.proxyPassword", <pwd>")
Sub SetProxy (hc As OkHttpClient, Host As String, Port As String)
Dim jo As JavaObject = hc
Dim proxy, socketaddress As JavaObject
socketaddress.InitializeNewInstance("java.net.InetSocketAddress", Array(Host, Port))
proxy.InitializeNewInstance("java.net.Proxy", Array("HTTPS", socketaddress))
jo.GetFieldJO("client").RunMethod("setProxy", Array(proxy))
End Sub
Please, note the use of HTTPS (original code was for HTTP).
TIA