高可扩展实时引擎SocketCluster.zip

时间:2022-08-07 21:03:58
【文件属性】:
文件名称:高可扩展实时引擎SocketCluster.zip
文件大小:209KB
文件格式:ZIP
更新时间:2022-08-07 21:03:58
开源项目 SocketCluster 是一个快速的,高度可扩展的 HTTP 实时服务器,它能帮助你建立充分利用所有 CPU 内核的多进程实时服务器。它除去了你作为单一线程运行 Node.js 服务器的限制,能让你的后端自动修复人工所造成的崩溃,而且可以将错误收集到*日志。安装:有两个安装 SocketCluster 的方法简单的方法:安装 SocketCluster 命令npm install -g socketcluster或者sudo npm install -g socketcluster然后socketcluster create myapp一旦安装完毕,找到你的新 myapp/ 目录,并登录node server访问 URL:http://localhost:8000/困难的方法:npm install socketcluster你还需要使用下面的指令来独立安装客户端:npm install socketcluster-clientsocketcluster-client 脚本是 socketcluster.js(位于主 socketcluster-client 目录)为了与 SocketCluster 交互,你应该在你的 HTML 页面用[removed]标签包括它。更多信息请查看https://github.com/SocketCluster/socketcluster-client建议你使用版本号不小于 0.10.22 的 Node.js,因为老的版本存在内存泄露。示例代码:var socketCluster = new SocketCluster({   balancers: 1,   workers: 3,   stores: 3,   port: 8000,   appName: 'myapp',   workerController: 'worker.js',   protocol: 'https',   protocolOptions: {     key: fs.readFileSync(__dirname   '/keys/enc_key.pem', 'utf8'),     cert: fs.readFileSync(__dirname   '/keys/cert.pem', 'utf8'),     passphrase: 'passphase4privkey'   } });
【文件预览】:
socketcluster-master
----scbroker.js(56B)
----bin()
--------cli.js(5KB)
----index.js(29KB)
----socketcluster-protocol.md(6KB)
----package.json(1008B)
----scworkercluster.js(6KB)
----test()
--------internal()
--------README.md(357B)
--------external()
----kubernetes()
--------scc-ingress.yaml(721B)
--------scc-state-deployment.yaml(733B)
--------scc-state-service.yaml(173B)
--------socketcluster-deployment.yaml(2KB)
--------scc-broker-deployment.yaml(1KB)
--------scc-broker-service.yaml(175B)
--------socketcluster-service.yaml(180B)
----sample()
--------package.json(886B)
--------broker.js(1KB)
--------server.js(4KB)
--------Dockerfile(287B)
--------worker.js(2KB)
--------dockerwait.js(1KB)
--------.dockerignore(46B)
--------public()
--------README.md(471B)
----assets()
--------scc-diagram.jpg(104KB)
--------logo.png(19KB)
----scc-guide.md(8KB)
----LICENSE(1KB)
----package-lock.json(22KB)
----default-workercluster-controller.js(75B)
----.npmignore(54B)
----.gitignore(66B)
----scworker.js(15KB)
----README.md(6KB)
----fsutil.js(1KB)
----.editorconfig(229B)

网友评论