socketcluster / scc-broker Goto Github PK
View Code? Open in Web Editor NEWServer for the SC cluster - For horizontal scalability.
License: MIT License
Server for the SC cluster - For horizontal scalability.
License: MIT License
@jondubois hey man,
On the scc-broker, which one (worker,broker) does the work? Basically, we have an scc-broker instance on a 4 core machine. I'm wondering if I should do worker:4
or broker:4
or worker:2,broker:2
.
Is there a list of possible middlewares that can be attached to the broker? I would like to essentially only publish some set of messages to the clients connected to this broker. The reason for this is to provide essentially unlimited scalability. As the brokers increase then the number of message senders will increase with them.
What might solve my problem is just getting a list of currently collected clients that I can loop over and emit to those clients. I'm assuming that it's somewhere on the broker. I hope this makes sense.
v6.0.2 isnt published to npmjs
In the guide over at "https://github.com/SocketCluster/socketcluster/blob/master/scc-guide.md" it says
The scc-broker service can be made up of any number of scc-broker instances - This is a special backend-only service which is designed to broker messages between multiple frontend-facing socketcluster instances. All the pub/sub channels in your entire system will be sharded evenly across available scc-broker instances. Just like with the socketcluster instances above, each scc-broker instance needs to point to a state server in order to work.
And the diagram shows that workers are part of the 'socketcluster' instances.
Can you please clarify this?
https://www.npmjs.com/package/scc-broker
V 1.5.1 is the latest present, 1.5.2 is available
Since scc-broker-client
in npm is v8, scc-broker
should also be updated from v7 to v8
I am using node v10.15.1.
When I run broker instance by:
SCC_STATE_SERVER_HOST='127.0.0.1' SCC_BROKER_SERVER_PORT='8888' node server
I got error as:
Origin: Worker (PID 51413)
[Error] WSEngineInitError: Compilation of µWebSockets has failed and there is no pre-compiled binary available for your system. Please install a supported C++11 compiler and reinstall the module 'sc-uws'
at native (/Users/annguyen/workspace/sccp/scc-broker/node_modules/sc-uws/uws.js:40:21)
at Object.<anonymous> (/Users/annguyen/workspace/sccp/scc-broker/node_modules/sc-uws/uws.js:46:3)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at new SCServer (/Users/annguyen/workspace/sccp/scc-broker/node_modules/socketcluster-server/scserver.js:106:54)
Hey,
When you clone the repo and add a AUTH_KEY it fails to add the handshake. Here is the code
Which one should I use? WS or SC?
if (AUTH_KEY) {
scServer.addMiddleware(scServer.MIDDLEWARE_HANDSHAKE, (req, next) => {
var urlParts = url.parse(req.url, true);
if (urlParts.query && urlParts.query.authKey == AUTH_KEY) {
next();
} else {
var err = new Error('Cannot connect to the cluster broker server without providing a valid authKey as a URL query argument.');
err.name = 'BadClusterAuthError';
next(err);
}
});
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.