There is already a rack handler in the repo. I should know because I submitted it. I'm including my code that I know it works. I only changed one line in rack.rb and created lsws.rb myself. I changed the .rb extensions to .txt to upload.
Hope this helps,