Fix URL scheme rewrite

The regex magic messes up the url. E.g. "https://null.org" would be
rewritten to "wss://.org".
Merge pull request #98 from khernyo/fix-url-scheme-rewrite

Fix URL scheme rewrite