403Webshell
Server IP : 185.208.173.17  /  Your IP : 87.236.161.98
Web Server : Microsoft-IIS/10.0
System : Windows NT SRV8576125506 10.0 build 26100 (Windows Server 2016) AMD64
User : IUSR ( 0)
PHP Version : 7.4.13
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/inetpub/wwwroot/parsmega.nuxt/node_modules/carrier/test/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/inetpub/wwwroot/parsmega.nuxt/node_modules/carrier/test/test_concatenation.js
var net     = require('net'),
    tap     = require('tap'),
    carrier = require('../lib/carrier.js');

tap.test("concatentation of fragmented line", function(t) {
  var server;
  var port = 4001;
  var to_be_sents = ["Hel", "lo ", "Wor", "ld"];
  var expected = to_be_sents.join('');

  t.plan(1);

  server = net.createServer(function(conn) {
    carrier.carry(conn, function(line) {
      t.equal(line, expected);
    });
  });
  server.listen(port);

  var client = net.createConnection(port);
  client.on('connect', function() {
    var sent_lines = 0;
    var next = function() {
      if (sent_lines !== to_be_sents.length) {
        client.write(to_be_sents[sent_lines], function() {
          sent_lines ++;
          next();
        });
      }
      else {
        client.end();
      }
    };
    next();
  });

  t.on("end", function() {
    server.close();
  });
});

Youez - 2016 - github.com/yon3zu
LinuXploit