Support for SockJS Like Java webscoket clients

exaucae3 years ago

Does Traccar websocket endpoint have support for Java socketJs like websocket client?

Anton Tananaev3 years ago

It's a standard WebSocket endpoint, so it should be compatible with all clients that use standard WebSockets.

exaucae3 years ago

Problem is SockJs client expects, in addition to the websocket url (provided by traccar), a topic and a destination ( see https://www.baeldung.com/websockets-api-java-spring-client#2-the-stompsessionhandler). I have no clue on what should be mentionned there. Any insight?

Anton Tananaev3 years ago

The link you posted is talking about some STOMP protocol. Are you using that?

exaucae3 years ago

Yes, I am using Websocket over Stomp (org.springframework.web.socket.messaging.WebSocketStompClient )

Anton Tananaev3 years ago

You mean STOMP over WebSocket? Obviously it won't be compatible because we don't use STOMP.

exaucae3 years ago

Do you have any other suggestion to interface your websocket endpoint?

Anton Tananaev3 years ago

Don't have any specific suggestions, but there has to be a good number of libraries that support pure websockets.

exaucae3 years ago

For sure. Thanks !

exaucae3 years ago

Update: managed to query traccar endpoint with that pure websocket client. For the sake of posterity, I'll paste my flow in this repository: https://github.com/exaucae/traccar-websocket-client.git anytime soon.