Skip to content

Commit

Permalink
Merge pull request #2 from Kong/chore/update
Browse files Browse the repository at this point in the history
chore(*) update docs, license, deps
  • Loading branch information
subnetmarco committed Jan 15, 2019
2 parents a8d557e + 246b3b7 commit 781e84a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: node_js

node_js:
- "0.10"
- "node"

before_script:
- "node lib/server.js &"
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License

Copyright (c) 2013-2015 Mashape (https://www.mashape.com)
Copyright (c) 2013-2019 Kong (https://konghq.com)

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
2 changes: 1 addition & 1 deletion lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ if (cluster.isMaster) {
"size": msg.length
});

var buffer = new Buffer(response);
var buffer = Buffer.from(response);
udp_info_server.send(buffer, 0, buffer.length, rinfo.port, rinfo.address);
});
udp_info_server.bind(40001);
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
{
"name": "tcpbin",
"version": "1.0.0",
"version": "2.0.0",
"description": "A simple TCP server that echoes whatever it receives",
"author": "Mashape <support@mashape.com>",
"author": "Kong <support@konghq.com>",
"homepage":"https://www.tcpbin.org",
"dependencies": {},
"devDependencies": {
"mocha": "~1.13.0",
"should": "~4.3.1"
"mocha": "~5.2.0",
"should": "~13.2.3"
},
"private": false,
"engines": {
"node": ">=0.10.0 <0.11"
"node": ">=0.10.0"
},
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/Mashape/tcpbin"
"url": "https://github.com/Kong/tcpbin"
},
"bugs": {
"url": "https://github.com/Mashape/tcpbin/issues",
"email": "support@mashape.com"
"url": "https://github.com/Kong/tcpbin/issues",
"email": "support@konghq.com"
},
"scripts": {
"test": "mocha tests"
"test": "mocha tests --exit"
},
"main": "lib/server.js"
}
8 changes: 4 additions & 4 deletions tests/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('Tcpbin', function () {
client.write('TCP info test');
});
client.on('data', function(data) {
should(data.toString()).equal('{"client-ip":"127.0.0.1","data":[84,67,80,32,105,110,102,111,32,116,101,115,116],"text-data":"TCP info test","size":13}');
should(data.toString()).equal('{"client-ip":"::ffff:127.0.0.1","data":{"type":"Buffer","data":[84,67,80,32,105,110,102,111,32,116,101,115,116]},"text-data":"TCP info test","size":13}');
done();
});
});
Expand All @@ -38,7 +38,7 @@ describe('Tcpbin', function () {
should(message.toString()).equal('UDP echo test');
done();
});
var message = new Buffer('UDP echo test');
var message = new Buffer.from('UDP echo test');
client.send(message, 0, message.length, 40000, "127.0.0.1", function(err, bytes) {
if (err) throw err;
});
Expand All @@ -47,10 +47,10 @@ describe('Tcpbin', function () {
it('should get info', function (done) {
var client = dgram.createSocket('udp4');
client.on('message', function(message, remote) {
should(message.toString()).equal('{"client-ip":"127.0.0.1","data":[85,68,80,32,105,110,102,111,32,116,101,115,116],"text-data":"UDP info test","size":13}');
should(message.toString()).equal('{"client-ip":"127.0.0.1","data":{"type":"Buffer","data":[85,68,80,32,105,110,102,111,32,116,101,115,116]},"text-data":"UDP info test","size":13}');
done();
});
var message = new Buffer('UDP info test');
var message = new Buffer.from('UDP info test');
client.send(message, 0, message.length, 40001, "127.0.0.1", function(err, bytes) {
if (err) throw err;
});
Expand Down

0 comments on commit 781e84a

Please sign in to comment.