Git Product home page Git Product logo

http-echo-server's Introduction

http-echo-server

Will accept any TCP connection and echo back a HTTP response with the entire content of the incoming TCP connection.

The server makes no attempt to understand the incoming HTTP request hence it doesn't know when the request is completed and therefore just terminates the TCP connection 2 seconds after the first data packet.

npm Build status js-standard-style

Installation

To setup a simple echo-server on Heroku just click this button:

Deploy

Note that the Heroku routing stack will proxy the incoming request and add custom HTTP headers.

Alternatively, to start it locally just run (only supported on newer versions of npm):

npx http-echo-server

Or if you whish to install the module globally:

npm install http-echo-server -g

Example usage

Just curl the URL of the app:

curl http://<heroku-app-name>.herokuapp.com

Alternatively - if installed locally - you can start the server using the command http-echo-server, take note of the port it starts on and then curl it:

curl http://localhost:<port>

Setting listening port

To set the http port, either supply the port as an argument to the http-echo-server executable:

http-echo-server 3005

Or use the PORT environment variable:

export PORT=3005
http-echo-server

License

MIT

http-echo-server's People

Contributors

watson avatar aloisioaw-epilot avatar bearjaws avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.