Skip to content
mini-TCP stack in Ruby, for fun
Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets
examples
Gemfile
Gemfile.lock
README.md
tcp.rb

README.md

teeceepee

This is a tiny TCP stack implemented in pure Ruby, for fun and learning, inspired by @jvns.

Julia wrote a blog called: What happens if you write a TCP stack in Python?, and I saved it to my Pocket and then moved it to Chrome bookmark folder called "Call me maybe", but never touched it ever since.

Recently, I decided to give it a try and implement a tiny tcp stack in Ruby language.

There is an example in examples/get_page.rb, you could open it and update the FAKE_IP_ADDRESS and the webpage you would like to get. Then, just run it in your terminal:

bundle install
sudo ruby examples/get_page.rb

Example

I run it with Ruby 2.2.2 on Linux. There is an issue of PacketFu gem to get it working on Mac OS X.

I wrote a blog about some details of this fun project, go check it out Write a TCP Stack in Ruby.

You can’t perform that action at this time.