I don't know the difference between fopen and fsockopen.
They both give a stream, but I'm not sure you can send custom headers with fopen..