-
-
Save arvitaly/a671451a8ef3587a9f558719ae571193 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const net = require("net"); | |
const server = net | |
.createServer(function(socket) { | |
socket.on("data", function(data) { | |
if (data.toString() === "close") { | |
socket.end(); | |
} else { | |
socket.write(data.toString()); | |
} | |
}); | |
}); | |
server.listen(2222, "0.0.0.0"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment