Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
spacebro-client
Advanced tools
Allow to automagically 🌟 connect to a Spacebro server
npm i -S spacebro-client
First, you need to start a spaceBro server. To run one locally, run the following line in your terminal (mind that you need to have spaceBro installed):
spacebro
Then, it's time to write some code:
const spacebroClient = require('spacebro-client')
spacebroClient.connect('localhost', 8888, {
computer: 'foo',
channel: 'bar'
})
spacebroClient.on('pong', function () { console.log('pong') })
spacebroClient.emit('ping')
Allows you to connect to a spaceBro server. Options is hash table of settings that will be used to define your client. If you choose not to pass an address (string) and a port (integer), spaceBro will try to connect to a server using MDNS.
Available options are :
Broadcast a specific event to all the apps in the channel. data must be an object.
Send an event to a specific target in the channel. data must be an object.
Listen to a specific event.
Listen to a specific event, the listener only once.
Before you send an event to the server, all packers associated with that event and all global packers (with no associated event) are called and applied to that event. They receive a single argument which is an object with two properties, the eventName and the data, and can return a new version of those data. If nothing is returned, the message will remain unchanged.
Unpackers are call when you receive a message from the server, before any handler is called. You can use to alter data (same as packers) but also to check the message as if an unpacker returns false, the message will not be sent to the handlers, it will also break the unpacking chain.
Please follow standard style conventions.
You can modify the source in src/index.js
. Run npm run build
to transpile and test.
Enjoy !
FAQs
🌟 Connect easily to a Spacebro server
The npm package spacebro-client receives a total of 8 weekly downloads. As such, spacebro-client popularity was classified as not popular.
We found that spacebro-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.