npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

submergence

v0.0.2

Published

submergence =========== Client authentication and messaging backplane service API.

Downloads

3

Readme

submergence

Client authentication and messaging backplane service API.

The state of the art in realtime, and particularly in peer to peer, is that even with the best shims easy jobs never are. "Room"-based libraries make lovely tutorials and demos but the leap from these barely-functional user experiences to a usable, scalable social application is too complex for anyone but the top competitive voip companies to manage.

The goal of substation is to bridge that gap by reversing signal flow. A user logged in to your application no longer has to ask to be reachable, they are reachable by identity as soon as their Socket.io connection becomes active. Connection multiplicity is embraced by shipping events to groups of related useragents (usually multiple tabs). Robust WebRTC peer "Links" are provided that automatically connect and reconnect new connections to the Link as long as both peers maintain at least one connection to the server.

Whether your application is a game server, a social application, a collaborative editing tool, a telecom service or something totally novel to Planet Earth, substation aims to support your signaling requirements, at scale, out of the box.

Deployment

A MongoDB cluster is required for storing session and live connection metadata.

substation runs on Node.js and installs with npm. It is configured and launched from a parent script and does not have a CLI tool. A simple, robust, cross-platform way to keep your server running is to launch it with [forever] (https://github.com/foreverjs/forever).

npm install --save substation
npm install -g forever
forever myApp.js

Like most webapp servers, substation must live behind a gateway server for load-balancing. The load balancer must be "sticky" - a frequent stream of requests from the same agent must be routed to the same service node. This is a requirement of Socket.io. substation also currently expects the load-balancer to terminate ssl connections.

The recommended load balancer for substation is nginx. Your configuration should contain something like this:

upstream myapp {
    ip_hash;
    server alfa.myapp.com;
    server sierra.myapp.com;
    server hotel.myapp.com;
}

server {
    Listen              443 ssl;
    server_name         myapp.com;
    ssl_certificate     myapp.com.crt;
    ssl_certificate_key myapp.com.key;

    location / {
        proxy_set_header    X-Real-IP $remote_addr;
        proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header    Host $http_host;
        proxy_set_header    X-NginX-Proxy true;
        proxy_http_version  1.1;
        proxy_set_header    Upgrade $http_upgrade;
        proxy_set_header    Connection "upgrade";
        proxy_redirect      off;
        proxy_pass          http://myapp/;
    }

    location /static {
        root                www/myapp;
    }
}

Application Notes

Vital information relating to the deployment of a submergence environment.

###Proxy Settings The recommended proxy is nginx.

  • "sticky load balancing" must be used.
  • The http header "Host" must be overwritten. Do not trust a client's headers!

###Database Setup submergence relies on MongoDB and is designed to scale by sharding.