Created
November 18, 2013 12:52
-
-
Save manuelmorales/7527288 to your computer and use it in GitHub Desktop.
Echo HTTP server in sinatra
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
set :port, 8080 | |
get '/*' do | |
puts "[ECHO] #{request.host}:#{request.port}#{request.path}?#{request.user_agent}" | |
end | |
# redirect port 80 traffic with | |
# sudo iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j REDIRECT --to-ports 8080 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment