Skip to content

hackvan/tcp-protocol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

HTTP basic examples inside the TCP layer

These are examples with Node and Ruby for try to make a (very) basic HTTP server to return responses for the HTTP/1.1 protocol version.

Requirements:

$ node -v
v10.16.0

$ ruby -v
ruby 2.6.3p62

Run the Servers:

Javascript

$ node node/index.js

Ruby

$ ruby ruby/server.rb

Try with:

  • Web Browser

    http://localhost:3000

  • Telnet CLI

    $ telnet localhost 3000
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.

    Type in: GET / HTTP/1.1

    Return:

    HTTP/1.1 200 OK
    
    <h1>Hola Mundo</h1>Connection closed by foreign host.

Resources:

  1. Make It Real - Tutorial
  2. Ruby Docs - Sockets

About

Making an HTTP server with Node and Ruby in the TCP layer.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published