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

socket.io-push

v0.9.15

Published

socket.io-push server by xuduo

Downloads

116

Readme

push-server 5分钟搭建指南

一台普通配置的服务器, 如我们使用的16G内存 CPU Xeon E5-2620, 可以很轻松的支撑20万日活APP的推送任务.

install

  • 如果使用苹果apns推送,由于node-http2兼容性问题 node版本必须是6.2.2

https://nodejs.org/en/download/package-manager/

安装/启动redis

redis-server &
mongod &

安装/更新socket.io-push

sudo npm install -g socket.io-push@version
##npm安装运行, 也可以直接clone代码, 在push-server目录运行node .

新建工作目录, 用于存储日志, 配置文件

mkdir push-server    
cd push-server
generate-push-server-config

run

push-server -f
-f foreground启动,不指定会后台启动

配置

默认地址

Q&A

  1. 如何多机部署?

proxy,api,apn-proxy均可以独立部署。只需保证配置中连接同一个mongodb,同一组redis。建议在调用机器上直接部署api进程。proxy前端机器独立部署。

proxy,api,apn-proxy启动多少个进程,由各自config中instance控制,一般api只需要一个即可,proxy cpu数量/2。

  1. 多个proxy前端情况下,如何负载均衡?

依靠dns解析到所有前端ip,当然也可以使用lvs。Nginx是不行的,由于长连接是一对一,nginx最多能把机器出口ip占完6w多个连接,远远不能满足需要

  1. 如何指定只发安卓或者ios?

notification接口里只传ios或者android,即可指定单一平台发送