the other node.js example

Posted on 2014-08-12
Last Modified: 2014-08-19
From the home page of

Here is an example of a simple TCP server which listens on port 1337 and echoes whatever you send it:

var net = require('net');

var server = net.createServer(function (socket) {
  socket.write('Echo server\r\n');

server.listen(1337, '');

I can run this ...  but how do I sent a message that will be echoed by the server?
Question by:knowlton
    LVL 21

    Accepted Solution

    You can use a telnet client:

    telnet 1337

    then just type
    LVL 5

    Author Comment

    It works!!

    Is there a way to keep the characters from doing this:

    ffoooo bbaarr

    I mean - the server is supposed to echo what I type, which it is, but it just looks strange.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    The viewer will learn how to dynamically set the form action using jQuery.
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now