Thanks for the link. Proxomitron was what I wanted.
Of course, in the time it took for me to get proxomitron's horrible looks-like-regex-but-isn't matcher to actually do what I wanted, I could have just written the proxy in the first place. This is exactly the kind of situation that makes me dislike this whole computer thing. I know that 1000 people have already written exactly what I want, but I have to write it again anyway.