Page 1 of 1

Website canno't access server

Posted: Mon Apr 06, 2015 10:21 am
by syyfilis
Hello, i am running pokermavens pro and having problem with my website accessing server. Here is what i am doing:
User creates account on my website.
Php collects information and sends all the information with pokermaven api to the server
With $api->Error i am getting result: Failed to connect to /Server IP/ port 8087: Connection refused

IF i put /server IP/:8087 to my aadress bar i get connection to my server and i can play poker fine. If i make just /server IP/:8087/api?Username=....... i get the correct response.
Port 8087 and 8088 are open and on server machine there is no firewall or antivirus porgrams running..
I am wondering why i can play poker with my friends on the server but the website canno't access it..

Where do i have to look next?

Re: Website canno't access server

Posted: Mon Apr 06, 2015 12:45 pm
by Kent Briggs
syyfilis wrote:With $api->Error i am getting result: Failed to connect to /Server IP/ port 8087: Connection refused
Most likely, the web host where your php code is running has a firewall setting blocking outgoing connections. Typically they may block everything except port 80 and maybe port 443 for SSL. You'll need to get them to whitelist your file port. Make it clear that you need that for an outgoing connection to another server you own, not for an incoming connection to their server.

Re: Website canno't access server

Posted: Fri Apr 10, 2015 9:33 am
by syyfilis
Aftter having web host open up te port im geting error: "Connection timed out after 30003 milliseconds".
Here is the code:

$params = array("Command" => "AccountsList", "Fields" => "Custom");
$api = Poker_API($params);
if($api->Result =="Ok"){
echo $api->Result;
}
else{
echo $api->Error;
}

The function Poker_API is copy-paste from your website with my api pw.

Re: Website canno't access server

Posted: Fri Apr 10, 2015 9:50 am
by Kent Briggs
syyfilis wrote:Aftter having web host open up te port im geting error: "Connection timed out after 30003 milliseconds".
Sounds like there is still a outbound firewall issue on your PHP site. Can you get a response from the API if you manually enter a command in your browser's URL box? If so, then the poker server end is fine. The 30-second timeout is specified in the Poker_API function in this line:

curl_setopt($curl, CURLOPT_TIMEOUT, 30);

You could increase that number but it shouldn't take anywhere near 30 seconds to get a response anyway.

Re: Website canno't access server

Posted: Fri Apr 10, 2015 10:05 am
by syyfilis
I totaly solved the problem, it was still web host blocking the connection. Thanks for the help.