Converted proxyTicket to middleware, Fixes #25