
Security News
November CVEs Fell 25% YoY, Driven by Slowdowns at Major CNAs
November CVE publications fell 25% YoY even as 2025 totals rose, showing how a few major CNAs can swing “global” counts and skew perceived risk.
@solana/rpc-subscriptions-channel-websocket
Advanced tools
An RPC Subscriptions transport that uses WebSockets
This package allows developers to create custom RPC Subscriptions channels. Using these primitives, developers can create custom channels that perform transforms on messages sent and received, perform autopings, and implement custom channel pooling strategies.
createWebSocketChannel()Creates an object that represents an open channel to a WebSocket server.
You can use it to send messages by calling its send() function and you can receive them by subscribing to the RpcSubscriptionChannelEvents it emits.
import { createWebSocketChannel } from '@solana/rpc-subscriptions-channel-websocket';
const abortController = new AbortController();
const webSocketChannel = await createWebSocketChannel({
sendBufferHighWatermark: Number.POSITIVE_INFINITY,
signal: abortController.signal,
url: 'wss://api.mainnet-beta.solana.com',
});
const channel = {
...webSocketChannel,
on(type, listener, options) {
if (type !== 'message') {
return webSocketChannel.on(type, listener, options);
}
return webSocketChannel.on(
'message',
function deserializingListener(message: string) {
const deserializedMessage = JSON.parse(message);
listener(deserializedMessage);
},
options,
);
},
send(message) {
const serializedMessage = JSON.stringify(message);
return webSocketChannel.send(serializedMessage);
},
} as RpcSubscriptionsChannel<unknown, unknown>;
channel.on(
'error',
e => {
console.log('Received error', e);
abortController.abort();
},
{ signal: abortController.signal },
);
channel.on(
'message',
m => {
console.log('Received message', m);
abortController.abort();
},
{ signal: abortController.signal },
);
await channel.send({ id: 1, jsonrpc: '2.0', method: 'getSlot' });
sendBufferHighWatermarkThe number of bytes to admit into the WebSocket's send buffer before queueing messages on the client.
When you call send() on a WebSocket the runtime might add the message to a buffer rather than send it right away. In the event that socket.bufferedAmount exceeds the value configured here, messages will be added to a queue in your application code instead of being sent to the WebSocket, until such time as the bufferedAmount falls back below the high watermark.
signalAn AbortSignal to fire when you want to explicitly close the WebSocket.
If the channel is open it will be closed with the code 1000, representing a normal closure. If the channel has not been established yet, firing this signal will result in the AbortError being thrown to the caller who was trying to open the channel.
urlA string representing the target endpoint. In Node, it must be an absolute URL using the ws or wss protocol.
FAQs
An RPC Subscriptions transport that uses WebSockets
The npm package @solana/rpc-subscriptions-channel-websocket receives a total of 383,321 weekly downloads. As such, @solana/rpc-subscriptions-channel-websocket popularity was classified as popular.
We found that @solana/rpc-subscriptions-channel-websocket demonstrated a healthy version release cadence and project activity because the last version was released less than 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
November CVE publications fell 25% YoY even as 2025 totals rose, showing how a few major CNAs can swing “global” counts and skew perceived risk.

Security News
React disclosed a CVSS 10.0 RCE in React Server Components and is advising users to upgrade affected packages and frameworks to patched versions now.

Research
/Security News
We spotted a wave of auto-generated “elf-*” npm packages published every two minutes from new accounts, with simple malware variants and early takedowns underway.