
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
The Symple Node.js server is a real time messaging server built on top of socket.io
and redis
for creating blazing fast messaging applications quickly and easily. Use cases include chat, sms, media streaming, and games that run in the web browser, desktop, or on mobile devices.
Symple is an unrestrictive real time messaging and presence protocol that implements the minimum number of features required to build full fledged messaging applications with security, flexibility, performance and scalability in mind. These features include:
Install Redis Note that Redis is optional, but required if you want to share secure sessions. If you're using Ubuntu just type:
sudo apt-get install redis-server
Install Symple from npm:
npm install symple
# use the --save flag to automatically add Symple to your package.json dependencies
# npm install symple --save
Done.
To get started straight away fire up the default server by typing:
node server
# or using npm
# npm start
The server.js
file in the root directory of the repo provides an example of how to include the Symple server in your own code:
// include Symple
var Symple = require('symple');
// instantiate the Symple server
var sy = new Symple();
// load a config file
sy.loadConfig(__dirname + "/symple.json");
// initialize the server
sy.init();
// access socket.io instance methods if required
// sy.io.use(function(socket, next) { });
// access HTTP/S server instance methods if required
// sy.http ...
// access Redis publish/subscribe client instance methods
// sy.pub ...
// sy.sub ...
console.log('Symple server listening on port ' + sy.config.port);
See the configuration options below for a list of available options.
Once the server is up and running you need a client to connect to it. There are a number of options here in the following languages:
To configure the server just modify symple.json
as needed:
{
/*
The port to listen on (default: 4500).
If `process.env.PORT` is set, the env value will be used instead.
Port 443 should always be used for SSL.
*/
"port" : 4500, /* 443 */
/*
Session time-to-live in minutes (default: 15 minutes)
This is the duration of time before sessions expire after the client disconnects.
If set to `-1` the session will never expire.
*/
"sessionTTL" : 15,
/* Enable or disable authentication */
"authentication" : true,
/*
Redis configuration
Redis must be available if using `authentication = true`
*/
"redis" : {
"host" : "localhost",
"port" : 6379,
"password" : "redispwd"
},
/* SSL configuration */
"ssl" : {
"enabled" : false,
"key" : "ssl/symple.key",
"cert" : "ssl/symple.crt"
}
}
Symple server class.
Kind: global class
Access: public
Param | Type | Description |
---|---|---|
config | Object | optional confguration object (see config.json) |
config.port | string | the port to listen on |
config.redis | Object | redis configuration |
config.ssl | Object | ssl configuration |
config.sessionTTL | number | session timeout value |
config.authentication | boolean | enable/disable authentication |
Load configuration from a file.
Kind: instance method of Symple
Access: public
Param | Type | Description |
---|---|---|
filepath | string | absolute path to config.json |
Initialize the Symple server.
Kind: instance method of Symple
Access: public
Shutdown the Symple server.
Kind: instance method of Symple
Access: public
Broadcast a message over the given socket.
Kind: instance method of Symple
Access: public
Param | Type | Description |
---|---|---|
socket | Socket | client socket |
message | Object | message to send |
Get a peer session by it's token.
Kind: instance method of Symple
Access: public
Param | Type | Description |
---|---|---|
token | Object | address string |
fn | function | callback function |
Touch a peer session by it's token and extend it's lifetime by (config.sessionTTL) minutes.
Kind: instance method of Symple
Access: public
Param | Type | Description |
---|---|---|
token | Object | address string |
fn | function | callback function |
Parse a peer address with the format: user@group/id
Kind: instance method of Symple
Access: public
Param | Type | Description |
---|---|---|
str | Object | address string |
Contributions are always welcome :)
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)For more information check out the Symple homepage: http://sourcey.com/symple/ For bugs or issues please use the Github issue tracker: https://github.com/sourcey/symple-server-node/issues
FAQs
Realtime messaging and presence server
We found that symple 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
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.