How are we supposed to know the correct details when we don't even know what you're implementing? We can't help you with your current script if you weren't parsing plain http content, because that's all that seems to be available. You can connect on port 80 to do so, but again this might have to be done from scratch. Or not. Because we don't know what you have.