It's pretty close to the real CGI protocol. The only thing missing below is setting up some environment variables, and giving the CGI script access to the body of the request via stdin.