 
     # Register current device to remote Cozy and then save related informations
     # to the config file
-    addRemote: (url, syncPath, deviceName, callback) =>
-        unless url.match /^https?:\/\//
-            log.warn "Your URL looks invalid: #{url}"
+    addRemote: (cozyUrl, syncPath, deviceName, callback) =>
+        parsed = url.parse cozyUrl
+        parsed.protocol ?= 'https:'
+        cozyUrl = url.format parsed
+        unless parsed.protocol in ['http:', 'https:'] and parsed.hostname
+            log.warn "Your URL looks invalid: #{cozyUrl}"
             callback? err
             return
         deviceName ?= os.hostname() or 'desktop'

            @askPassword,
            (password, next) ->
                options =
                    url: url
                    deviceName: deviceName
                    password: password
                Devices.registerDevice options, next

            if err
                log.error err
                log.error 'An error occured while registering your device.'
                if parsed.protocol is 'http:'
                    log.warn 'Did you try with an httpS URL?'
            else
                options =
                    path: path.resolve syncPath
                    url: cozyUrl
                    deviceName: deviceName
                    password: credentials.password
                @config.addRemoteCozy options
