i have downloaded the example in this tutorial and i want to connect it to my server for test.
the web socket i'm using works fine and for connection it needs user name and password.
B4X:
Sub Process_Globals
Private wsh As WebSocketHandler
Private link As String = "ws://5*.3*.126.245:37*1/ws"
End Sub
this is the way to set ip and port but how set user name and password for connection
Sub Globals
Private cred As String
Dim su As StringUtils
Dim encoded As String
Dim mp As Map
End Sub
Sub Activity_Create(FirstTime As Boolean)
cred = "****rto:****BAR2210"
lst.Initialize
encoded = su.EncodeBase64(cred.GetBytes("UTF8"))
If FirstTime Then
wsh.Initialize(Me)
End If
Activity.LoadLayout("1")
mp = CreateMap("Authorization":"Basic "&encoded)
wsh.Headers(mp)
End Sub