
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
@bsv/authsocket-client
Advanced tools
This repository provides a drop-in client-side solution for Socket.IO that signs all outbound messages and verifies inbound messages using BRC-103.
authsocket
) or any custom server that can verify BRC-103 messages.socket.io-client
usage.npm install
Wallet
(e.g., from @bsv/sdk
or your own).Below is a minimal client code that wraps socket.io-client
:
import { AuthSocketClient } from '@bsv/authsocket-client'
import { ProtoWallet } from '@bsv/sdk' // your BRC-103-compatible wallet
// Create or load your local BRC-103 wallet
const clientWallet = new ProtoWallet('client-private-key-hex')
// Wrap the normal Socket.IO client with AuthSocketClient
const socket = AuthSocketClient('http://localhost:3000', {
wallet: clientWallet
})
// Standard Socket.IO usage
socket.on('connect', () => {
console.log('Connected to server. Socket ID:', socket.id)
// Emit a sample message
socket.emit('chatMessage', {
text: 'Hello from client!'
})
})
socket.on('chatMessage', (msg) => {
console.log('Server says:', msg)
})
socket.on('disconnect', () => {
console.log('Disconnected from server')
})
AuthSocketClient(serverUrl, options)
to create a BRC-103-secured socket client..on(...)
, .emit(...)
as normal.AuthSocketClient
creates an internal BRC-103 Peer
that handles:
'authMessage'
channel is used for the underlying BRC-103 handshake. You only interact with standard Socket.IO event names (like 'chatMessage'
), as AuthSocketClient
automatically re-dispatches them.Transport
interface on the client side.socket.io-client
for raw message passing via the 'authMessage'
channel.Peer
calls this transport to send and receive raw BRC-103 frames.io(url, managerOptions)
from socket.io-client
.SocketClientTransport
.Peer
with your wallet
..on(eventName, callback)
and .emit(eventName, data)
methods.Note: If you want to see a full end-to-end example, combine the server code from the
authsocket
README with the client code from theauthsocket-client
README, then run both. You should see messages securely exchanged and logs showing mutual authentication in action.
See LICENSE.txt.
FAQs
Mutually Authenticated Web Sockets Client
The npm package @bsv/authsocket-client receives a total of 16 weekly downloads. As such, @bsv/authsocket-client popularity was classified as not popular.
We found that @bsv/authsocket-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.