
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
@signalk/client
Advanced tools
A Javascript SDK for Signal K clients. Provides various abstract interfaces for discovering (via optional mDNS) the Signal K server and communication via WebSocket & REST. Aims to implement all major APIs in the most recent Signal K version(s)
A Javascript SDK for Signal K clients. Provides various abstract interfaces for discovering the Signal K server and communication via WebSocket & REST. Aims to implement all major APIs in the most recent Signal K version(s).
[sudo] npm install --save @signalk/client
import Client, { Discovery } from '@signalk/client'
import Bonjour from 'bonjour'
let client = null
// Instantiate client
client = new Client({
hostname: 'demo.signalk.org',
port: 80,
useTLS: true,
reconnect: true,
autoConnect: false
})
// Instantiate client with authentication
client = new Client({
hostname: 'demo.signalk.org',
port: 80,
useTLS: false,
rejectUnauthorized: false, // Optional, set to false only if the server has a self-signed certificate
useAuthentication: true,
reconnect: true,
autoConnect: false,
username: 'demo@signalk.org',
password: 'signalk'
})
// Discover client using mDNS
// Params: bonjour lib, search time
const bonjour = Bonjour()
const discovery = new Discovery(bonjour, 60000)
// Timeout fires when search time is up and no servers were found
discovery.on('timeout', () => console.log('No SK servers found'))
// Found fires when a SK server was found
discovery.on('found', server => {
if (server.isMain() && server.isMaster()) {
client = server.createClient({
useTLS: false,
useAuthentication: true,
reconnect: true,
autoConnect: true,
notifications: false,
username: 'sdk@decipher.industries',
password: 'signalk'
})
}
})
// Delta Stream over WS usage
// 1. Stream behaviour selection
client = new Client({
hostname: 'demo.signalk.org',
port: 80,
useTLS: true,
reconnect: true,
autoConnect: false,
notifications: false,
// Either "self", "all", "none", or null (see below)
// - null: no behaviour is set for the delta stream, default behaviour is used. Use this option when connecting to older devices that don't support the subscription modifiers per query request. See https://signalk.org/specification/1.4.0/doc/subscription_protocol.html.
// - "self" provides a stream of all local data of own vessel
// - "all" provides a stream of all data for all vessels
// - "none" provides no data over the stream
deltaStreamBehaviour: 'self'
})
// 2. Subscribe to specific Signal K paths
client = new Client({
hostname: 'demo.signalk.org',
port: 80,
useTLS: true,
reconnect: true,
autoConnect: false,
notifications: false,
subscriptions: [{
context: 'vessels.*',
subscribe: [
{
path: 'navigation.position',
policy: 'instant'
}
]
}]
})
// 3. Listen to the "delta" event to get the stream data
client.on('delta', (delta) => {
// do something with delta
})
// 4. Modify your subscription parameters. Can be a single object or an array.
client.subscribe([{
context: 'vessels.*',
subscribe: [
{
path: 'navigation.position',
policy: 'instant'
}
]
}])
// 5. Unsubscribe from all data paths.
client.unsubscribe()
// REST API usage
// 1. Fetch an entire group
client
.API() // create REST API client
.then(api => api.navigation())
.then(navigationGroupResult => {
// Do something with navigation group data
})
// 2. Fetch a specific path
client
.API() // create REST API client
.then(api => api.get('/vessels/self/navigation/position')) // Path can be specified using dotnotation and slashes
.then(positionResult => {
// Do something with position data
})
// 3. Fetch meta for a specific path
client
.API() // create REST API client
.then(api => api.getMeta('vessels.self.navigation.position'))
.then(positionMetaResult => {
// Do something with position meta data
})
// 4. Fetch the entire tree for the local vessel
client
.API() // create REST API client
.then(api => api.self())
.then(selfResult => {
// Do something with boat data
})
// ... check out the tests for more REST API examples
Angular: Signal K client for the Angular framework signalk-client-angular
FAQs
A Javascript SDK for Signal K clients. Provides various abstract interfaces for discovering (via optional mDNS) the Signal K server and communication via WebSocket & REST. Aims to implement all major APIs in the most recent Signal K version(s)
The npm package @signalk/client receives a total of 342 weekly downloads. As such, @signalk/client popularity was classified as not popular.
We found that @signalk/client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.