Hi,
I have been looking at the Login System filters tutorial (https://www.b4x.com/android/forum/threads/server-login-system-filters-tutorial.39020/#content) and have a question with it.
In my Main Module I have:
I then have a Class called 'OnlineSocket' and I am logging when a user connects etc.
I am also using the jNetwork library. This will listen for TCP & UDP messages coming from a Telnet device. (ServerSocket)
What I am trying to do is detect the incoming TCP/UDP message (which I have working) and only send that incoming message to some of the logged in user as a WebSocket.
For Example:
User 1 (User)
User 2 (User)
User 3 (Admin)
User 4 (User)
I only want the incoming messages from the TCP/UDP connection to be sent as a WebSocket message to the Admin (user 3) and user 1, 2 & 4 shouldn't see this WebSocket message.
Any ideas on how I can send a WebSocket message to only specific users from a different module (from the incoming TCP/UDP Module) ?
I have been looking at the Login System filters tutorial (https://www.b4x.com/android/forum/threads/server-login-system-filters-tutorial.39020/#content) and have a question with it.
In my Main Module I have:
B4X:
srvr.Initialize("srvr")
srvr.Port = 8888
srvr.AddWebSocket("/ws", "OnlineSocket")
srvr.StaticFilesFolder = File.Combine(File.DirApp, "www")
srvr.LogsFileFolder = File.Combine(File.DirApp, "logs")
srvr.AddFilter("/login_example/members/*", "MembersFilter", False)
Dim err As Map
err.Initialize
err.Put(404, "/404.html") 'page not found
err.Put(500, "/500.html") 'server error
srvr.SetCustomErrorPages(err)
srvr.Start
I then have a Class called 'OnlineSocket' and I am logging when a user connects etc.
B4X:
'WebSocket class
Sub Class_Globals
Private ws As WebSocket 'ignore
End Sub
Public Sub Initialize
End Sub
Private Sub WebSocket_Connected (WebSocket1 As WebSocket)
Log("Connected")
ws = WebSocket1
End Sub
Private Sub WebSocket_Disconnected
Log("Disconnected")
End Sub
I am also using the jNetwork library. This will listen for TCP & UDP messages coming from a Telnet device. (ServerSocket)
What I am trying to do is detect the incoming TCP/UDP message (which I have working) and only send that incoming message to some of the logged in user as a WebSocket.
For Example:
User 1 (User)
User 2 (User)
User 3 (Admin)
User 4 (User)
I only want the incoming messages from the TCP/UDP connection to be sent as a WebSocket message to the Admin (user 3) and user 1, 2 & 4 shouldn't see this WebSocket message.
Any ideas on how I can send a WebSocket message to only specific users from a different module (from the incoming TCP/UDP Module) ?