https://github.com/abdenasser/http_server_with_ruby
https://github.com/abdenasser/http_server_with_ruby
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/abdenasser/http_server_with_ruby
- Owner: Abdenasser
- Created: 2016-12-04T19:36:18.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-04T20:46:01.000Z (almost 9 years ago)
- Last Synced: 2025-02-10T06:45:15.582Z (8 months ago)
- Language: Ruby
- Size: 5.86 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# http server with ruby
### The TCP server & client
First start the server by running `ruby tcp_server.rb`, and then start the client in a separate terminal tab or window by running `ruby tcp_client.rb` to receive the server’s message.
### The http server (http_server.rb)
the web server looks mostly the same as the TCP server we created earlier. The general idea is the same, we’re just using the HTTP protocol to format our message. Also, because we’ll use a browser to send requests and parse responses, we won’t have to implement a client this time.
start the server by running `ruby http_server.rb`
then open http://localhost:5678 in your browser.