Code Monkey home page Code Monkey logo

Comments (2)

FLYBYME avatar FLYBYME commented on July 19, 2024

This is the code im running.

//192.168.1.101:9879
var dhtPort = 20001
var serverPort = 9879

var Protocol = require('bittorrent-protocol')
var net = require('net')

net.createServer(function(socket) {
    var wire = new Protocol()

    // pipe to and from the protocol
    socket.pipe(wire).pipe(socket)

    wire.on('handshake', function(infoHash, peerId) {
    console.log('handshake')
    })

    wire.on('unchoke', function() {
        console.log('peer is no longer choking us: ' + wire.peerChoking)
    })
}).listen(serverPort);

The client im using is utorrent 2.2

More error:

bittorrent-protocol [7cfa097b] new wire +0ms
bittorrent-protocol [7cfa097b] Error: wire not speaking BitTorrent protocol (?!??♂??→?↨ ????§????m▬.¶??E;↨?&?♠?       "?_♫z??R????DU?]???h???♣►☼?♠??
.?}??$?@?Zv?8???V???_??IJ???§↑?5?u'?-{↑???y??.B????`??♣?e???kF2???l???k?c??k??L[?- A?1>??;6??2?[♂5?
?e??SC?5?∟?☺??n?
B?Fb????) +204ms
bittorrent-protocol [7cfa097b] end +4ms
bittorrent-protocol [7cfa097b] got uninterested +0ms
bittorrent-protocol [7cfa097b] got choke +1ms
bittorrent-protocol [e8e24ae6] new wire +48s
&It?↔F↓??B?|??I?↔?♂?n#U?R)?u?↨?F|? ) +2mse not speaking BitTorrent protocol (?????
bittorrent-protocol [e8e24ae6] end +1ms
bittorrent-protocol [e8e24ae6] got uninterested +0ms
bittorrent-protocol [e8e24ae6] got choke +1ms
``

from bittorrent-protocol.

feross avatar feross commented on July 19, 2024

When you get the 'handshake' event, you need to immediately respond with a wire.handshake() back.

wire.on('handshake', function(infoHash, peerId) {
  wire.handshake(infoHash, myPeerId)
})

from bittorrent-protocol.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.