Support for SockJS Like Java webscoket clients

exaucae 4 years ago

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

Anton Tananaev 4 years ago

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

exaucae 4 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 Tananaev 4 years ago

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

exaucae 4 years ago

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

Anton Tananaev 4 years ago

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

exaucae 4 years ago

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

Anton Tananaev 4 years ago

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

exaucae 4 years ago

For sure. Thanks !

exaucae 4 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.