/**
 * Protocol (http or https) of the current request.
 */
function fb_protocol() {
  return (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
}

Should also test $_SERVER['HTTP_X_FORWARDED_FOR'] variable.
My drupal website is behind a https proxy and the fb_protocol is always set as "http"

Comments

kacy created an issue.