When I call https(443) connection with Snoopy and call again http(80) connection with same connection, $port value has '443'. and warning occured like below:
Warning: stream_socket_client(): unable to connect to tcp://www.abc.com:443 (Connection refused) in /home/ukits/extract_html/_common/anylogin/lib/Snoopy.class.php on line 875
For example:
$loginAfterUrl = 'http://www.abc.com';
$loginUrl = 'https://login.abc.com';
$loginFormInputArray = array(...);
$getHttpUrl = 'http://www.abc.com/board';
$Snoopy = new Snoopy;
$Snoopy->referer = $loginAfterUrl;
$Snoopy->submit($loginUrl, $loginFormInputArray);
$Snoopy->setcookies();
$Snoopy->fetch($getHttpUrl); // it has warning
$Snoopy->rawheaders;
$result = $Snoopy->results;
Thanks for the bug report. This issue has been fixed in Snoopy 2.0.0
The test I used which works in Snoopy 2.0.0 and fails in Snoopy 1.2.5 is
You can get the new version of Snoopy 2.0.0 here
I still had the problem. I fixed it by setting the correct port when http is detected.
At line 866 switch to this:
Last edit: Funkybunch 2016-06-29