A comprehensive Node.js implementation of the Minecraft Votifier protocol with full support for both v1 (RSA) and v2 (HMAC-SHA256) protocols. Features robust RSA key format support and full compatibility with Java-based Votifier servers like VotifierPlus.
- ๐ Complete Protocol Support: Both Votifier v1 and v2 implementations
- ๐ Robust RSA Key Parsing: Supports SPKI, PKCS#1, base64, XML, and hex formats
- ๐ค Java Server Compatible: Tested with VotifierPlus and other Java implementations
- ๐ Web Testing Interface: Beautiful dark-themed web UI for testing votes
- ๐ฆ Zero Dependencies: Pure Node.js implementation (web tester uses Express)
- ๐งช Comprehensive Tests: Full test suite with real-world scenarios
- ๐ Rich Documentation: Complete examples and API documentation
git clone https://github.com/yourusername/nodejs-votifier.git
cd nodejs-votifierconst { newV1Client, newV2Client, newVote } = require('./nodejs-votifier');
// Create a vote
const vote = newVote('MyService', 'PlayerName', '127.0.0.1');
// V1 Client (RSA)
const v1Client = newV1Client('localhost:8192', publicKey);
await v1Client.sendVote(vote);
// V2 Client (HMAC-SHA256)
const v2Client = newV2Client('localhost:8192', 'secret-token');
await v2Client.sendVote(vote);nodejs-votifier/
โโโ lib/ # Core library
โ โโโ index.js # Main exports
โ โโโ vote.js # Vote class
โ โโโ protocol-v1.js # V1 protocol implementation
โ โโโ protocol-v2.js # V2 protocol implementation
โ โโโ v1-client.js # V1 client
โ โโโ v2-client.js # V2 client
โ โโโ server.js # Votifier server
โ โโโ utils.js # Utility functions
โโโ examples/ # Usage examples
โโโ test/ # Test suite
โโโ README.md
votifier-web-tester/ # Web testing interface
โโโ server.js # Express.js backend
โโโ public/ # Frontend assets
โโโ package.json
# Start example server
npm run example-server
# Test V1 client
npm run example-client-v1
# Test V2 client
npm run example-client-v2const { newV1Client, newVote } = require('./lib');
const publicKey = `-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA...
-----END PUBLIC KEY-----`;
const client = newV1Client('localhost:8192', publicKey);
const vote = newVote('WebTester', 'TestUser', '127.0.0.1');
try {
await client.sendVote(vote);
console.log('โ
Vote sent successfully!');
} catch (error) {
console.error('โ Vote failed:', error.message);
}const { newV2Client, newVote } = require('./lib');
const client = newV2Client('localhost:8192', 'your-secret-token');
const vote = newVote('WebTester', 'TestUser', '127.0.0.1');
try {
await client.sendVote(vote);
console.log('โ
Vote sent successfully!');
} catch (error) {
console.error('โ Vote failed:', error.message);
}Launch the beautiful web testing interface:
cd votifier-web-tester
npm install
npm startVisit http://localhost:3000 to access the testing interface with:
- ๐จ Modern Dark Theme: Beautiful, responsive design
- ๐ Protocol Switching: Easy V1/V2 protocol selection
- ๐ Smart Forms: Auto-validation and error handling
- โก Real-time Testing: Instant feedback and results
- ๐ง RSA Key Generation: Built-in key pair generator
Run the comprehensive test suite:
npm testThis library automatically detects and supports multiple RSA key formats:
- SPKI: Standard
-----BEGIN PUBLIC KEY-----format - PKCS#1:
-----BEGIN RSA PUBLIC KEY-----format - Base64: Raw base64 encoded keys
- XML:
<RSAKeyValue>XML format - Hex: Hexadecimal encoded keys
Fully tested and compatible with:
- โ VotifierPlus (Bukkit/Spigot/Paper)
- โ Votifier (Original Bukkit plugin)
- โ NuVotifier (BungeeCord)
- โ Custom Java implementations
const vote = newVote(serviceName, username, address, timestamp);
// Creates a new vote instanceconst client = newV1Client(address, publicKey);
await client.sendVote(vote);const client = newV2Client(address, token);
await client.sendVote(vote);const server = newVotifierServer(port, privateKey, tokens);
server.listen();RSA Key Format Error
Error: Failed to parse RSA public key
- Solution: Use the robust key parsing - supports multiple formats automatically
V2 Connection Closed
Error: Connection closed before receiving response
- Solution: This may be normal - some servers close connection after successful vote
V2 Signature Invalid
Error: signature invalid
- Solution: Verify your token matches the server configuration exactly
- ๐๏ธ Production Ready: Thoroughly tested with real Minecraft servers
- ๐ Protocol Complete: Full v1 and v2 support with all features
- ๐ ๏ธ Developer Friendly: Rich examples, documentation, and error handling
- ๐ฏ Java Compatible: Works seamlessly with existing Java servers
- ๐ Modern Node.js: Clean async/await API with Promise support
This project is licensed under the MIT License - see the LICENSE file for details.
Ported from the excellent go-votifier library. Special thanks to the original authors and the Minecraft community for their contributions to the Votifier protocol.
Contributions are welcome! Please feel free to submit a Pull Request.
Made with โค๏ธ for the Minecraft community