 user = new User()
 
 replications = {}
+
+
+# Add https in case the protocol is not specified in the url
+addProtocol = (url) ->
+    url = "https://" + url if url?.indexOf("://") is -1
+    return url
 
 
 # Called each time a change occurs in the _replicator db

    else
        # Add the credentials in the url
        auth = "#{params.id}:#{params.target.token}"
        url = params.target.recipientUrl.replace "://", "://#{auth}@"

        # Remove last slash in recipient's url
        if url.charAt(url.length - 1) is '/'

            # Avoid empty usernames
            if not params.sharerName? or (params.sharerName is '')
                params.sharerName = params.sharerUrl.replace "https://", ""

            # Add https if not specified
            url = addProtocol url
            # Send to recipient
            remote = request.createClient url
            remote.post path, params, (err, result, body) ->
