Sets port defaults to 80 and 443 (SSL)
Strips leading slash from resource path
Merge pull request #23 from xavi-js/bugfix/websocket-url

Ensure that WebSocket URL is well formed