webtorrent / bittorrent-tracker

🌊 Simple, robust, BitTorrent tracker (client & server) implementation
https://webtorrent.io
MIT License
1.75k stars 317 forks source link

Fix documentation for server implementation #403

Closed Bruce-Hopkins closed 2 years ago

Bruce-Hopkins commented 2 years ago

I noticed two issues with the server code example:

  1. The documentation for the server implementation includes the line server.ws

    But in documentation, we don't console.log the port like we do HTTP and UTP:

    server.on('listening', function () {
    // fired when all requested servers are listening
    console.log('listening on http port:' + server.http.address().port)
    console.log('listening on udp port:' + server.udp.address().port)
    })
  2. The three variables being used on the server.listen() function are not defined.

    server.listen(port, hostname, onlistening)

    Can I add these to the doc?