Subscribe to all rover
WebSocket endpoint
Headers
Authorization: Bearer Token
Header parameter
Authorization
Bearer b2335d2cee91b9a4c05e4585...==
Authorization token
Response parameter
code
0
Number
Status code
msg
Success
String
Status code description
data
Array
Data content
data[idx].id
68a29126e2cc922e3a08ab57
String
Rover Id
data[idx].data
$GPGGA,023617.017,...*5B\r\n
String
NMEA 0183 GGA string(s)
Response example
{
"code": 0,
"data": [
{
"id": "68a29126e2cc922e3a08ab57",
"data": "$GPGGA,023617.017,3723.993880,N,12159.157465,W,1,00,0.000,0,M,0,M,1.000,0001*5B\r\n"
},
{
"id": "78a29126e2cc922e3a08ab57",
"data": "$GPGGA,023617.017,3723.993880,N,12159.157465,W,1,00,0.000,0,M,0,M,1.000,0001*5B\r\n$GPGGA,023617.017,3723.993880,N,12159.157465,W,1,00,0.000,0,M,0,M,1.000,0001*5B\r\n"
}
]
}Clients
- Using wscat (Node.js cli)
wscat -c 'wss://nmea.geodnet.com/rover/v1/subscribe/all' \
-H "Authorization: Bearer $TOKEN"- Using websocat (cross-platform)
websocat -H="Authorization: Bearer $TOKEN" \
wss://nmea.geodnet.com/rover/v1/subscribe/all- Using JavaScript (browser console or Node with isomorphic-ws)
const token = 'YOUR_TOKEN_HERE';
const ws = new WebSocket('wss://nmea.geodnet.com/rover/v1/subscribe/all', [], {
headers: { Authorization: `Bearer ${token}` } // Node.js clients (ws) support headers
});
// For browsers, you cannot set custom headers; see note below.
ws.onopen = () => console.log('connected');
ws.onmessage = (ev) => console.log('msg:', ev.data);
ws.onerror = (e) => console.error('ws error', e);
ws.onclose = () => console.log('closed');- Using Node.js with ws (supports headers)
const WebSocket = require('ws');
const token = process.env.TOKEN;
const ws = new WebSocket('wss://nmea.geodnet.com/rover/v1/subscribe/all', {
headers: { Authorization: `Bearer ${token}` }
});
ws.on('open', () => console.log('connected'));
ws.on('message', (data) => console.log('msg:', data.toString()));
ws.on('error', (err) => console.error('error:', err));
ws.on('close', () => console.log('closed'));NoteBrowsers do not allow setting arbitrary WebSocket headers. If you must use a browser, consider a backend proxy that injects the Authorization header, or use a token in the URL query string only if the server supports it (not recommended unless explicitly allowed).
Last updated
