Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
API to uniformely perform (a)synchronous http requests and websocket connections
Antena is an API to uniformely perform (a)synchronous http requests and websocket connections. The end points of an Antena communication channel are different: one is called receptor while the other is called emitter. To be operational, receptors must be attached to a node http server or a web worker. While emitters should receive information to connect to a receptor at their creation. Usage here, live demo here.
Handlers
handlers.onrequest(method, path, headers, body, callback)
handlers :: antena.Handlers
method :: string
path :: string
headers :: {string}
body :: string
callback(status, reason, headers, body)
status :: number
reason :: string
headers :: {string}
body :: string
handlers.onconnect(path, websocket)
handlers :: antena.Handlers
path :: string
websocket :: antena.Websocket
Receptor
antena.Receptor := antena.ReceptorServer | antena.ReceptorWorker
receptor = require("antena/receptor")(handlers)
handlers :: antena.Handlers
receptor :: antena.ReceptorServer
receptor = require("antena/receptor/worker")(handlers)
handlers :: antena.Handlers
receptor :: antena.ReceptorWorker
receptor2 = receptor1.merge(receptors)
receptor1 :: antena.Receptor
receptors :: {antena.Receptor}
receptor2 :: antena.Receptor
receptor2 = receptor1.trace(name)
receptor1 :: antena.Receptor
name :: string
receptor2 :: antena.Receptor
receptor.attach(server)
receptor :: antena.ReceptorServer
server :: http.Server
worker = receptor.spawn(url)
receptor :: antena.ReceptorWorker
url :: string | object-url
worker :: EventTarget
terminate()
error :: ErrorEvent
message :: string
filename :: string
lineno :: number
colno :: number
onrequest = receptor.handler("request")
receptor :: antena.ReceptorServer
onrequest(request, response)
request :: http.IncomingMessage
response :: http.ServerResponse
onupgrade = receptor.handler("upgrade")
receptor :: antena.ReceptorNode
onupgrade(request, socket, head)
request :: http.IncomingMessage
socket :: net.Socket
head :: Buffer
Emitter
emitter = require("antena/emitter/node")(host, secure)
host :: string
secure :: boolean
emitter :: antena.Emitter
emitter = require("antena/emitter/browser")(host, secure)
host :: string
secure :: boolean
emitter :: antena.Emitter
emitter = require("antena/emitter/worker")(size)
size :: number
emitter :: antena.Emitter
emitter = require("antena/emitter/mock")(receptor)
receptor :: antena.ReceptorNode | antena.ReceptorBrowser
emitter :: antena.Emitter
emitter.request(method, path, headers, body, callback)
emitter :: antena.Emitter
method :: string
path :: string
headers :: {string}
body :: string
callback(error, status, reason, headers, body)
error :: Error | null
status :: number | undefined
reason :: string | undefined
headers :: {string} | undefined
body :: string | undefined
[error2, status2, reason2, headers2, body2] = emitter.request(method1, path1, headers1, body1)
emitter :: antena.Emitter
method1 :: string
path1 :: string
headers1 :: {string}
body1 :: string
error2 :: Error | null
status2 :: number | undefined
reason2 :: string | undefined
headers2 :: {string} | undefined
body2 :: string | undefined
websocket = emitter.connect(path)
emitter :: antena.Emitter
path :: string
websocket :: antena.Websocket
emitter2 = emitter1.fork(splitter)
emitter1 :: antena.Emitter
splitter :: string
emitter2 :: antena.Emitter
emitters = emitter.split(splitters)
emitter :: antena.Emitter
splitter :: [string]
emitters :: {antena.Emitter}
emitter2 = emitter1.trace(name)
emitter1 :: antena.Emitter
name :: string
emitter2 :: antena.Emitter
Websocket
state = websocket.readyState
websocket :: antena.Websocket
state : number
"open"
websocket.send(message)
websocket :: antena.Websocket
message :: string | ArrayBuffer
"message"
message :: string | ArrayBuffer
websocket.close(code, reason)
websocket :: antena.Websocket
code(number)
reason(string)
"close"
code :: number
reason :: string
"error"
error :: Error
FAQs
Simple messaging protocol for node's net socket
The npm package antena receives a total of 2 weekly downloads. As such, antena popularity was classified as not popular.
We found that antena 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.