Wizatek Seguir
Gamma
Verificación en dos pasos activada
¡Ha verificado su Paypal!
Verificado por Binance
¡Usuario con pocos negocios! ¡Utiliza siempre saldo de Forobeta!
- Desde
- 17 Dic 2020
- Mensajes
- 456
Hola chicos.
La verdad es que ya no se ni donde colocarlo ya que en ningun lado saben de lo hablo.
Estoy intentando crear un servidor tracker de torrents por websocket y hay una libreria en nodejs muy buena que es https://github.com/webtorrent/bittorrent-tracker la cuestion es que tal vez este haciendo algo mal ya que ami no me funciona.
Este tracker usa exactamente lo mismo: https://tracker.files.fm:7073/stats, puedo conectarme y todo, pero el mio queda tal que asi:
Y no responde al websocket.
Funcional:
El mio:
El codigo que ejecuto es este:
Alguien sabe algo?
La verdad es que ya no se ni donde colocarlo ya que en ningun lado saben de lo hablo.
Estoy intentando crear un servidor tracker de torrents por websocket y hay una libreria en nodejs muy buena que es https://github.com/webtorrent/bittorrent-tracker la cuestion es que tal vez este haciendo algo mal ya que ami no me funciona.
Este tracker usa exactamente lo mismo: https://tracker.files.fm:7073/stats, puedo conectarme y todo, pero el mio queda tal que asi:
Y no responde al websocket.
Funcional:
El mio:
El codigo que ejecuto es este:
Insertar CODE, HTML o PHP:
import { Server } from 'bittorrent-tracker'
const server = new Server({
udp: true, // enable udp server? [default=true]
http: true, // enable http server? [default=true]
ws: true, // enable websocket server? [default=true]
stats: true, // enable web-based statistics? [default=true]
trustProxy: false // enable trusting x-forwarded-for header for remote IP [default=false]
})
// Internal http, udp, and websocket servers exposed as public properties.
server.http
server.udp
server.ws
server.on('error', function (err) {
// fatal server error!
console.log(err.message)
})
server.on('warning', function (err) {
// client sent bad data. probably not a problem, just a buggy client.
console.log(err.message)
})
server.on('listening', function () {
// fired when all requested servers are listening
// HTTP
const httpAddr = server.http.address()
const httpHost = httpAddr.address !== '::' ? httpAddr.address : 'localhost'
const httpPort = httpAddr.port
console.log(`HTTP tracker: http://${httpHost}:${httpPort}/announce`)
// UDP
const udpAddr = server.udp.address()
const udpHost = udpAddr.address
const udpPort = udpAddr.port
console.log(`UDP tracker: udp://${udpHost}:${udpPort}`)
// WS
const wsAddr = server.ws.address()
const wsHost = wsAddr.address !== '::' ? wsAddr.address : 'localhost'
const wsPort = wsAddr.port
console.log(`WebSocket tracker: ws://${wsHost}:${wsPort}`)
})
// start tracker server listening! Use 0 to listen on a random free port.
const port = 80
const hostname = "localhost"
server.listen(port, hostname, () => {
// Do something on listening...
})
// listen for individual tracker messages from peers:
server.on('start', function (addr) {
console.log('got start message from ' + addr)
})
server.on('complete', function (addr) {})
server.on('update', function (addr) {})
server.on('stop', function (addr) {})
// get info hashes for all torrents in the tracker server
Object.keys(server.torrents)
Alguien sabe algo?