forked from PrivateCoffee/transfer.coffee
Kumi
f2ece65e12
Replaced incorrect curly braces in the console log statement with proper template literals to accurately display the HOST and PORT values. This ensures the tracker URL is displayed correctly in the console, improving debugging and monitoring.
25 lines
No EOL
513 B
JavaScript
25 lines
No EOL
513 B
JavaScript
import { Server } from 'bittorrent-tracker';
|
|
|
|
const PORT = process.env.TRACKER_PORT || 8106;
|
|
const HOST = process.env.TRACKER_HOST || 'localhost';
|
|
|
|
const server = new Server({
|
|
udp: true,
|
|
http: true,
|
|
ws: true,
|
|
stats: true,
|
|
});
|
|
|
|
server.on('error', (err) => {
|
|
console.error(`Error: ${err.message}`);
|
|
});
|
|
|
|
server.on('warning', (err) => {
|
|
console.warn(`Warning: ${err.message}`);
|
|
});
|
|
|
|
server.on('listening', () => {
|
|
console.log(`Tracker is listening on http://${HOST}:${PORT}`);
|
|
});
|
|
|
|
server.listen(PORT); |