Unfortunately you using a protocol (HTTP) which is designed for simple request/response type communications between a web browser and a web server. It is not designed for long running connections between two applications like you are trying to do with CGI:IRC.
It's a similar problem as what...