• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/classes/general/im_rest.php
  • Класс: CIMRestService
  • Вызов: CIMRestService::getServerAddress
static function getServerAddress()
{
	$publicUrl = BitrixMainConfigOption::get('main', 'last_site_url', '');

	if ($publicUrl)
	{
		return $publicUrl;
	}
	else
	{
		return (BitrixMainContext::getCurrent()->getRequest()->isHttps() ? "https" : "http")."://".$_SERVER['SERVER_NAME'].(in_array($_SERVER['SERVER_PORT'], Array(80, 443))?'':':'.$_SERVER['SERVER_PORT']);
	}
}