
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Pushy is a Publish/Subscribe system for realtime web applications. This is the server-side made on top of NodeJS and SockJS.
npm install pushy
$ node pushy-server.js config.json
To trigger an event on a specific channel, hit the following URL with the required parameters. POST data will be sent alongside the event.
http(s)://<pushy-host>:<pushy-port>/pushy/channel/<channel-name>/trigger?event=<event-name>×tamp=<current-ts>&auth_key=<auth-key>
Parameters:
pushy-host
: the hostname of your Pushy serverpushy-port
: the listening port you defined in config.jsonchannel-name
: name of the channel where the event should be dispatchedevent-name
: name of the eventcurrent-ts
: your app's timestamp (UNIXTIME). 600 seconds difference (+/-) is tolerated.auth-key
: SHA256 auth key for this command (read more bellow)The authentication key is a SHA256 sum of:
<channel>:<event>:<timestamp>:<JsonEncodedBody>:<secretKey>
Example: we want to send a test event to the Hello channel, the current timestamp is 123456789 and we don't send any data. Our secret key is secret.
signature string: hello:test:123456789:{}:secret
auth_key: d7f4c3309757c4025269b6576eae10028ec0711c88e6ef605bb44d149cb07803
Any channel named private-
something will require an authentification string sent on subscription. If any complementary data is sent, presence will be enabled too.
The authentication token should be generated server-side when requested by the client. Then the client should resend his subscription request with this token. The authentication token is a SHA256 hash generated by this signature string:
<connection_id>:<channel>[:<JsonEncodedPresenceData>]:<secretKey>
Parameters:
connection_id
: The connection ID (given to client on connection)channel
: Lowercased channel nameJsonEncodedPresenceData
optional : Json encoded presence data (if any)secretKey
: Your configured secret keyWhen presence is enabled on a channel, presence data sent on subscription will be shared between members everytime a new subscriber join.
The channel will trigger two additionnal events:
pushy:presence-add
: when a new subscriber join (with its presence data)pushy:presence-quit
: when a subscriber quitWhen subscribing to a presence-enabled channel, the client will recieve presence data from all current subscribers.
IMPORTANT : Presence data is SHARED so please don't put passwords or any sensitive data here. Since its sent very often, it might also be a good idea to keep this data as light as possible (just a username and his avatar-url for example).
port
int : HTTP Port number (default is 8123)secretKey
string : Secret/long string used server-side to do authentification.ssl
boolean : Run as an HTTPS server (defaults to false)sockjs
object : Default SockJS options (see SockJS documentation)Commands are callables made available to the client to interact with your Pushy server througth the SockJS socket. Obviously, the two default commands are SUBSCRIBE and UNSUBSCRIBE but you can easily add other commands to fit your needs. This can be useful for games, chats etc..
A command signature looks like this:
// Command example
//
// @param SockJsServer sockjs The SockJS server handle (@see lib/sockjs-server.js)
// @param SockJSConnection connection The SockJS connection handle sending the command
// @param Object data Data sent alongside the command
// @param Manager channels Channels Manager instance (@see lib/manager.js)
function(sockjs, connection, data, channels) {
// do something
}
This software is licensed under the MIT License. Please refer to the LICENSE file for more details.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
FAQs
The official Node.js package for sending push notifications with Pushy.
The npm package pushy receives a total of 2,669 weekly downloads. As such, pushy popularity was classified as popular.
We found that pushy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.