Replace only the protocol part of the URL in Socket#connect.

In method DefaultSocket#connect, the code replaces all "http" or "ws" substrings, not just the protocol part.