in reply to My simple idea.

merlyn did something similar in his Web Techniques column a couple of years ago. See columns 23 and 24 for more details.

Basically, he uses the HTTP::Daemon module from LWP, spawns off a new server for each connection, and redirects to the new port. Pretty ingenious technique, and a lot easier than using IO::Socket calls. (Trust me on this.)