fixed parsing of socks header