
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@bottlenose/rxsocketio
Advanced tools
@bottlenose/rxsocketio
is part of the Bottlenose project. It is a simple, lightweight package which makes it easy to create two-way data streams using Socket.io and RxJS's pipeable operators. Its intent is to encapsulate common websocket patterns (that normally require dozens or hundreds of lines of code to implement) into one-line operators that rely on convention and configuration instead of muddying up your codebase.
npm i @bottlenose/rxsocketio --save
Or...
yarn add @bottlenose/rxsocketio
Platform | Support |
---|---|
node.js (>10.0) | ✅ |
Browsers | ✅ |
React Native | ✅ |
Electron | ✅ |
import {from} from 'rxjs';
import {conduit} from '@bottlenose/rxsocketio';
const messageIn$ = from([
{topic: 'message', body: 'yarrr'},
{topic: 'message', body: 'arrr matey'},
{topic: 'message', body: 'Vitamin C? Never heard of it.'},
]);
const socketConfig = {
url: 'http://localhost:9080/ws', // socket.io server
topics: ['message'], // topics to subscribe to. (Defaults to ['message']).
};
// the conduit operator sends messages from messageIn$ and emits messages
// from the server
const messageBack$ = messageIn$.pipe(conduit({...socketConfig}));
messageBack$.subscribe(console.log);
// {topic: 'message', body: 'Welcome Matey.'}
// {topic: 'message', body: 'Yo ho. Yo ho. I am a message from the server.'}
The library also supports some advanced features commonly needed in real applications (like sending binary, verifying receipt of messages before sending the next, customizing the socket.io client, serializers/deserializers and handling disconnections). See the documentation for more information.
FAQs
RxJS operators for handling socket.io connections
We found that @bottlenose/rxsocketio demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.