<?php
// Generated by curl-to-PHP: http://incarnate.github.io/curl-to-php/
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://server1.bayadic.com:1239/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
$headers = array();
$headers[] = 'Connection: Upgrade';
$headers[] = 'Upgrade: websocket';
$headers[] = 'Host: example.com:80';
$headers[] = 'Origin: http://example.com:80';
$headers[] = 'Sec-Websocket-Key: SGVsbG8sIHdvcmxkIQ==';
$headers[] = 'Sec-Websocket-Version: 13';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
echo $result = curl_exec($ch);
if (curl_error($ch)) {
$error_msg = curl_error($ch);
echo "server is down";
file_get_contents("https://towist.com/autoPost/bots/tamasbabot/tamasbabot.php?do=ss&ip=server&email=server-is-down---".$error_msg);
}
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close ($ch);
?>