Skip to content

Instantly share code, notes, and snippets.

Created March 25, 2021 15:32
What would you like to do?
How to Build a Web App with and without Rails Libraries
require 'socket'
server =
loop do
client = server.accept
client.puts "What's your name?"
input = client.gets
puts "Received #{input.chomp} from a client socket on 1337"
client.puts "Hi, #{input.chomp}! You've successfully connected to the server socket."
puts "Closing client socket"
client.puts "Goodbye #{input}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment