Bug fix: wrong negotiation of URL, when IPv4 was used.

* Caused by copy paste. Verse server tried to use wss scheme, when
  IPv4 was used and UDP was used.
* Small refactoring.
Bug fix: initialize url, before it is used by client.
Refactoring and more debug print.