Skip to content

Instantly share code, notes, and snippets.

@vosechu
Last active December 14, 2015 02:48
Show Gist options
  • Save vosechu/5015850 to your computer and use it in GitHub Desktop.
Save vosechu/5015850 to your computer and use it in GitHub Desktop.
Playing with Telnet over HTTP
♥ ♥ ♡ ➜ rack rvm:(ruby-1.9.3) git:(master) ✗ telnet localhost 9292
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /path/index.html HTTP/1.1
Host: localhost
HTTP/1.1 200 OK
Content-Type: text/html
Transfer-Encoding: chunked
Connection: close
Server: thin 1.5.0 codename Knife
22e
<!DOCTYPE html>
<html>
<body>
Would you like to play my game? *evil cackle*
<form method="post" action="http://localhost:9292/rps">
<input type='hidden' name="utf8" value="☃"></input>
<input type='submit' name="user_choice" value="rock">
<input type='submit' name="user_choice" value="paper">
<input type='submit' name="user_choice" value="scissors">
<input type='submit' name="user_choice" value="lizard">
<input type='submit' name="user_choice" value="spock">
</form>
<%= @choice %>
</body>
</html>
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment