Is there any possible way to open a socket connection using the cURL functions in php? Tried this but to no avail:
<pre><?php
$url = 'irc.freenode.net';
$ch = curl_init();
$timeout = 10;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_PORT, 6667);
curl_setopt($ch, CURLOPT_FAILONERROR, true);
$output = @curl_exec($ch);
print_r(curl_getinfo($ch));
echo "\n\ncURL error number:" .curl_errno($ch);
echo "\n\ncURL error:" . curl_error($ch);
curl_close($ch);
?>
</pre>
It resulted in the following:
Quote:
Array
(
[url] => http://irc.freenode.net
[http_code] => 500
[header_size] => 0
[request_size] => 73
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 3.052355
[namelookup_time] => 0.380917
[connect_time] => 2.857148
[pretransfer_time] => 2.857186
[size_upload] => 0
[size_download] => 0
[speed_download] => 0
[speed_upload] => 0
[download_content_length] => 0
[upload_content_length] => 0
[starttransfer_time] => 3.052325
[redirect_time] => 0
)
cURL error number:22
cURL error:The requested URL returned error: 500
|
When I attempted to change the $url string to 'irc://irc.freenode.net/' it said it didn't support the irc protocol. Any ideas? I don't have access to the fsockopen() function.