Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Beams is a long-polling Node.js server extension and client library.
Install beams
in your project:
npm install --save beams
Then here's a simple chat server and client:
var server = require('express')();
server.listen(80);
var beams = require('beams');
beams.setServer(server);
var messages = [];
beams
.connect(function (beam) {
beam.emit('messages', messages);
})
.on('message', function (text) {
var message = {from: this.id, text: data};
messages.push(message);
beams.emit('messages', [message]);
});
<script src="http://localhost/beams-client.min.js"></script>
<script>
Beams()
.on('messages', function (data) {
console.log(data);
beam.emit('my other event', { my: 'data' });
});
</script>
Pass an Express-like server to setServer
, and it will create a Beams server on
top of the server.
route
on any assets that you'd like to route via server.get
Run a callback when a client connects.
When a message with a given name is received, run a callback on each client.
The callback
takes a data
argument, and its this
context is the client
on which it is being run.
Remove any existing handlers for the specified message name, and replace
with a single callback
, like calling beams.on
only once. This is useful
for frameworks that reload modules in dev mode rather than restarting the
server.
Send a named message with some data to every client.
Run a callback on each client. The callback
takes a client
argument.
A list of the clients that are connected.
Arrays of message handlers keyed by message name.
How long (in milliseconds) to wait before forcing clients to reconnect.
We would like to thank all of the amazing people who use, support, promote, enhance, document, patch, and submit comments & issues. Beams couldn't exist without you.
Additionally, huge thanks go to Goin’ for employing and supporting Beams project maintainers, and for being an epically awesome place to work (and play).
Copyright (c) 2014 Sam Eubank
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
We welcome contributions from the community and are happy to have them. Please follow this guide when logging issues or making code changes.
All issues should be created using the new issue form. Please describe the issue including steps to reproduce. Also, make sure to indicate the version that has the issue.
Code changes are welcome and encouraged! Please follow our process:
npm test
to run tests quickly, without testing coverage.npm run cover
to test coverage and generate a report.npm run report
to open the coverage report you generated.As contributors and maintainers of Beams, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
If any participant in this project has issues or takes exception with a contribution, they are obligated to provide constructive feedback and never resort to personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, edits, issues, and other contributions that are not aligned with this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
We promise to extend courtesy and respect to everyone involved in this project regardless of gender, gender identity, sexual orientation, ability or disability, ethnicity, religion, age, location, native language, or level of experience.
FAQs
A long-polling Node.js server and client
The npm package beams receives a total of 1 weekly downloads. As such, beams popularity was classified as not popular.
We found that beams 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.