       url_string = url_string + "#{k}=#{url_params[k]}&"
     url_string = url_string.slice(0, url_string.length - 1);
 
-    sign_string = "POST\n#{@hostname}\n#{endpoint}\n#{url_string}"
+    sign_string = "POST\n#{@hostname.split(':')[0]}\n#{endpoint}\n#{url_string}"
     digest = CryptoJS.HmacSHA256(sign_string, @appSecret).toString(CryptoJS.enc.Base64)
     url_params.sig = digest
 
-    @ajaxPost("https://#{@hostname}#{endpoint}", url_params, callback)
+    @ajaxPost("#{@scheme}://#{@hostname}#{endpoint}", url_params, callback)
 
   GUID: ->
     S4 = () => return Math.floor(Math.random() * 0x10000).toString(16)

    )

  createUser: (accessToken, callback) ->
    @ajaxPost("https://#{@hostname}/games/#{@appId}/users.json",
      {'access_token': accessToken, 'api_key': @udid},
      (statusCode) =>
        switch statusCode

    true

  validateUser: (callback) ->
    @ajaxGet("#{@scheme}://#{@hostname}/games/#{@appId}/users.json?id=#{encodeURIComponent(@udid)}",
      (statusCode) =>
        switch statusCode
          when 200
