
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
websocket_center
Advanced tools
version: v0.1.6
author: Blind Holmes
This is a frame of websocket developers for nodejs v10.15.2
install all package form folder root path the package.js file like:
npm install
and run app.js file with node
node app.js
then your websocket project was already run.
NOW THESE MESSAGE IS VERY IMPORTANTThis frame is not only a server use to get connection but also a client use to send command.
All message send and recive use JSON object.
All project send message must be a json object.
Like connection.sendMsg({success: true});
/config/config.js this.http = {
port: 8080
};
this.websocket = {
keepalive: true,
keepaliveInterval: 3000,
dropConnectionOnKeepaliveTimeout: true,
keepaliveGracePeriod: 60000,
autoAcceptConnections: false,
useSecProtocols: true,
secProtocols: 'echo-protocol'
};
// TEST CONFIG
this.redis = {
host: '127.0.0.1', // default
port: 6379, // default
max_clients: 30, // defalut
perform_checks: false, // checks for needed push/pop functionality
database: 0, // database number to use
perfix: "websocket_",
options: {
auth_pass: '233233233'
} // options for createClient of node-redis, optional
};
this.echoRule = {
enabled: false,
pingMsg: { //INIT ping massage JSON OBJ
type: 'ping'
},
pongMsg: {
type: 'pong' //INIT pong massage JSON OBJ
},
pingInterval: 3, //second
outOfCountKickConnection: 5, // out of this count then kick this connection
};
this.gatewayHostName = 'ws://192.168.10.102';
if your websocket keepalive ping/pong is not support by ISP.
then you can use a message ping/pong to keep connection alive.
change the enable to true to enable the message ping/pong.
pingInterval is second for send a ping message to all client pre time.
pingMsg will init the ping data format;
port: The listen port number of your web server;
keepalive: boolean of use websocket ping/pong.
keepaliveInterval: int second of every ping time.
connection.sendMsg(jsonObject)
send to this connection a msessage with Json Object.
connection.sendUTF(string)
send to this connection a msessage with String.
connection.close()
close this connection.
connection.ping(data)
send to this connection a websocket ping.
connection.pong(data)
send to this connection a websocket pong.
fns.sendToRemoteClientServer(wsAddress, callback)
send the message to remote websocket server.
websocket address like "ws://127.0.0.1"
callback param is this connection
useage:
fns.sendToRemoteClientServer("ws://127.0.0.1", function (connection) {
connection.sendMsg({msg: 'hello world'});
});
fns.registerWsServerAddress(wsAddress)
register the argument to websocket address like:
fns.registerWsServerAddress("ws://127.0.0.1");
fns.getClientIdByUniqueid(uniqueId, callback)
fns.bindUniqueIdToClient(uniqueId, clientId, callback)
fns.bindClientIdToServerAddress(clientId, serverAddress, callback)
fns.unbindClientId(clientId)
fns.sendToRemoteClient(clientId, json)
fns.sendToAllClient(json)
fns.sendToLocalClientById(clientId, msgJson)
fns.sendToAllLocatClient(msgJson)
fns.getIPAdress()
{
identity: String
command: String
snedMsg: String
}
this is in message send to websocket server on message only can be responseived.
server recive date only accept identity "backend", "client", "gateway".
like {identity: "backend"}
this is in message send to websocket server on message only can be responseived.
server recive date only accept command:
sendToClientById, sendToAllClient, sendToLocalClientById, sendToAllLocatClient.
{
identity: 'backend',
command: 'sendToClientById',
clientId: clientId,
sendMsg: {
type: 'count',
count: count,
serial: serial
}
};
FAQs
This is a frame of websocket developers for nodejs
We found that websocket_center demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.