
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
= pusher-client (Ruby)
pusher-client is a ruby gem for consuming WebSockets from the Pusher[http://pusherapp.com] web service.
The connection to Pusher can optionally be maintained in its own thread (see Asynchronous Usage).
This gem is compatible with jruby since 0.2.
== Installation
gem install pusher-client
== Single-Threaded Usage
The application will pause at socket.connect and handle events from Pusher as they happen.
require 'pusher-client'
PusherClient.logger = Logger.new(STDOUT) options = {:secret => YOUR_APP_SECRET} socket = PusherClient::Socket.new(YOUR_APP_KEY, options)
socket.subscribe('channel')
socket.subscribe('presence-channel', 'user_id')
socket.subscribe('presence-channel', 'user_id', { :name => 'name' })
['channel1', 'channel2'].each do |c| socket.subscribe("presence-#{c}", 'user_id') end
socket.bind('event') do |data| puts data end
socket['channel'].bind('event') do |data| puts data end
socket.connect
== Asynchronous Usage
The socket will remain open in the background as long as your main application thread is running, and you can continue to subscribe/unsubscribe to channels and bind new events.
require 'pusher-client'
PusherClient.logger = Logger.new(STDOUT) options = {:secret => YOUR_APP_SECRET} socket = PusherClient::Socket.new(YOUR_APP_KEY, options) socket.connect(true) # Connect asynchronously
socket.subscribe('channel')
socket.bind('event') do |data| puts data end
loop do sleep(1) # Keep your main thread running end
For further documentation, read the source & test suite. Some features of the JavaScript client are not yet implemented.
== Gotchas
When binding to a global event, note that you still must be subscribed to the channels the event may be sent on. You can't just bind a global event without subscribing to any channels and call it a day.
== Contributing to pusher-client
== TODOs
== Copyright
Copyright (c) 2010 Logan Koester. See LICENSE.txt for further details.
FAQs
Unknown package
We found that pusher-client-nc 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.