1.3.0 • Published 10 years ago
toxcore v1.3.0
node-toxcore

Node.js bindings for libtoxcore, built off of node-ffi.
Note: Installing this package does not install libtoxcore. It is expected that libtoxcore is installed prior to using node-toxcore.
New API Progress
- toxcore
- toxav
- toxdns
- toxencryptsave
- tox_old.h (old groupchats)
- Higher level API
Synchronous Example
var toxcore = require('toxcore');
// Create a default Tox instance
var tox = new toxcore.Tox();
// ... or, create a Tox instance using specific paths for toxcore libraries
var toxAtPath = new toxcore.Tox({
path: '/path/to/libtoxcore.so',
crypto: '/path/to/libtoxencryptsave.so'
});
// ... or, give Tox some data to load
var toxWithData = new toxcore.Tox({
data: '/path/to/toxfile'
});
// ... if that data is encrypted, include a passphrase
var toxWithEncData = new toxcore.Tox({
data: '/path/to/encrypted/toxfile',
pass: 'myPassphrase'
});
// Bootstrap from nodes (see a list at: https://wiki.tox.im/Nodes)
tox.bootstrapSync('23.226.230.47', 33445, 'A09162D68618E742FFBCA1C2C70385E6679604B2D80EA6E84AD0996A1AC8A074'); // stal
tox.bootstrapSync('104.219.184.206', 443, '8CD087E31C67568103E8C2A28653337E90E6B8EDA0D765D57C6B5172B4F1F04C'); // Jfreegman
// Set your name and status message
tox.setNameSync('My username');
tox.setStatusMessageSync('Hello world!');
// Listen for friend requests
tox.on('friendRequest', function(e) {
console.log('Friend request from: ' + e.publicKeyHex());
});
// Print received friend messages to console
tox.on('friendMessage', function(e) {
var friendName = tox.getFriendNameSync(e.friend());
console.log(friendName + ': ' + e.message());
});
// Print out your tox address so others can add it
console.log('Address: ' + tox.getAddressHexSync());
// Start!
tox.start();
For more examples, see the examples/
directory.
Documentation
Generating the documentation should be as easy as grunt jsdoc
.
1.3.0
10 years ago
1.2.0
10 years ago
1.1.4
10 years ago
1.1.3
10 years ago
1.1.2
10 years ago
1.1.1
10 years ago
1.1.0
10 years ago
1.0.2
10 years ago
1.0.1
10 years ago
1.0.0
10 years ago
0.0.18
10 years ago
0.0.17
10 years ago
0.0.16
10 years ago
0.0.15
10 years ago
0.0.14
10 years ago
0.0.13
10 years ago
0.0.12
10 years ago
0.0.11
10 years ago
0.0.10
10 years ago
0.0.9
10 years ago
0.0.8
10 years ago
0.0.7
10 years ago
0.0.6
10 years ago
0.0.5
10 years ago
0.0.4
10 years ago
0.0.3
10 years ago
0.0.2
10 years ago
0.0.1
10 years ago