You should get the session cookie from a session API call.
I GET the session that was
JSESSIONID : node0q90ykfyiwslpblv2x4y0s2qo0.node0
Where I should put it on websocket API ?
The best way to find out is by looking at the official web app with browser developer tools (network tab).
After I worked on it, the server response is:
Error: Unexpected server response: 200
Handshake Details
Status Code: 200 OK
Response Headers
Date: Wed, 25 Aug 2021 09:59:05 GMT
Last-Modified: Wed, 07 Jul 2021 13:32:31 GMT
Content-Type: text/html
Accept-Ranges: bytes
Cache-Control: max-age=3600,public
Content-Length: 610
Server: Jetty(10.0.3)
URL and body?
I see a suspicious Socket.IO
at the top. What does that mean?
It is uses for enables real-time, bidirectional, and event-based communication between web clients and servers, using WebSockets under the hood.
That's great, but Traccar doesn't use it.
Can you send to me any tutorial for testing the websocket API, I am still working on it around two weeks but I can't get it.
I just use web app and Chrome dev tools.
Okay, thanks
I got it!!
Basically you need to create the session get the JSESSIONID and pass it via header in postman.
I created the session, passed the session in the header and I get this error
HEAD ws://000.000.234.90:8082/api/socket
Error: Invalid protocol: ws:
Request Headers
User-Agent: PostmanRuntime/7.28.4
Accept: */*
Cache-Control: no-cache
Postman-Token: 717618d1-e27f-4c92-9d13-bd2a0daff7b9
Host: 000.000.234.90:8082
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Hi
I want to test websocket API using Postman program, I created a session and I got the Session cookie.
But I don't where and how put the session cookie content inside postman.
The Header of Postman websocket contains hidden headers as follow:
*Host
*Connection
*Upgrade
*Sec-WebSocket-Key
*Sec-WebSocket-Version
*Sec-WebSocket-Extensions
and these header can't change of its values