Is it possible to dynamically create a Java Endpoint Server? If not, would you use WebRTC?

0

Good evening. I am implementing a Chat service, where when clicking on the name of a user should open a private conversation window with it. Using Java, I am using WebSocket Server and Javascript for the Websocket Client.

My problem is that by connecting users to the same Endpoint, the message goes to everyone. I tried creating pass parameters in the Server path thinking it would be a different path for each chat, but once implemented I realized that I still sent the message to all connected users even passing different parameters. For example:

@ServerEndpoint("/privateServerEndpoint/{username1}/{username2}/{roomId}")

I know that I can send a message by filtering for "roomId" but this is not the intention, it is to make only the users of the room stay in the same Endpoint. Is it possible to branch an Endpoint? I thought that by way of passing parameter, the url would be "sub-room" of the privateServerEndpoint.

I'm starting to think so, so I did a little research and found the WebRTC that the Atom IDE uses to do P2P edit-sharing. So using WebRTC, could I do the Java Server where it would handle the connection between the two users and then the connection becomes directly between them?

    
asked by anonymous 15.03.2018 / 02:21

0 answers