- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
loop do
client = server.accept
otvet = []
while line = client.gets
otvet << line
break if line == "\r\n"
end
client.print "HTTP/1.1 200/OK\n"
client.print "Content-type: text/html\n\n"
client.print '"<meta http-equiv="refresh" content="0; url=http://www.google.ru">"' # переадресация
client.close
puts otvet
File.open('log.txt', 'a'){ |f| f.puts("#{otvet}")} # запись лога
end