Javascript 如何在节点js中发出rpc请求以使其泛滥?

Javascript 如何在节点js中发出rpc请求以使其泛滥?,javascript,node.js,rpc,Javascript,Node.js,Rpc,在过去的几天里,我一直在尝试发出一个rpc请求来淹没节点,但没有成功。我现在面临的问题是,例如,当我发送一个rpc请求时 [1,“daemon.login”[“用户名”、“密码”] 洪水没有任何反应,插座只是保持打开。 我在冗长模式下运行过洪水,巫婆根本帮不上忙。洪水给我的唯一信息是连接的客户端,它没有显示任何错误。那么我做错了什么 我尝试过的步骤: Zlib压缩要发送的数据 Bencode对压缩数据进行编码 把它送到洪水里去 我的代码: var tls = require('tls'); va

在过去的几天里,我一直在尝试发出一个rpc请求来淹没节点,但没有成功。我现在面临的问题是,例如,当我发送一个rpc请求时

[1,“daemon.login”[“用户名”、“密码”]

洪水没有任何反应,插座只是保持打开。 我在冗长模式下运行过洪水,巫婆根本帮不上忙。洪水给我的唯一信息是连接的客户端,它没有显示任何错误。那么我做错了什么

我尝试过的步骤:

  • Zlib压缩要发送的数据
  • Bencode对压缩数据进行编码
  • 把它送到洪水里去
  • 我的代码:

    var tls = require('tls');
    var net = require('net');
    var zlib = require('zlib');
    var bencode = require('bencode');
    process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
    
    var toSend = '[1, "daemon.login", ["the_username", "the_password"]]';
    
    new Promise((done, fail) => {
        zlib.deflate(toSend, (err, buffer) => {
            return done(bencode.encode(buffer));
        });
    }).then(buff => {
        var client = tls.connect(58846, '192.168.0.22', function() {
            console.log('CONNECTED');
            // Write a message to the socket as soon as the client is connected, the server will receive it as message from the client 
            client.write(buff);
            console.log('Wroten');
        });
        // Add a 'data' event handler for the client socket
        // data is what the server sent to this socket
        client.on('data', function(data) {
            console.log('DATA: ' + data);
            // Close the client socket completely
            client.destroy();
        });
    
        // Add a 'close' event handler for the client socket
        client.on('close', function() {
            console.log('Connection closed');
        });
    });
    
    ruby中的Florge rpc库:

    洪水RPC文档: