Not work requests with the port

Status
Not open for further replies.

onplayer

New Member
Messages
11
Reaction score
0
Points
1
Does not work appeal to the domain (or IP) by using the port.

Example:
Code:
file_get_contents('http://google.com');
WORK!

Code:
file_get_contents('http://google.com:80');
NOT WORK!

Why?

I want to use some of the API, but they work only with the port!

Example API:
http://ipgeobase.ru:7020/geo?ip=5.255.255.5&json=1

CURL also does not work.

Example:
Code:
$ch = curl_init();
curl_setopt_array($ch, array(
    CURLOPT_URL => 'http://ipgeobase.ru:7020/geo?ip=5.255.255.5&json=1',
    CURLOPT_RETURNTRANSFER => 1
));
exit(var_dump(curl_exec($ch)));
NOT WORK!
 

Dead-i

x10Hosting Support Ninja
Community Support
Messages
6,084
Reaction score
368
Points
83
Hi,

Please be aware that outbound connections to non-standard ports are automatically blocked by the firewall. If you try to connect to a site running on an unusual port, it is likely that the connection will time out.

Thank you,
 

onplayer

New Member
Messages
11
Reaction score
0
Points
1
Please be aware that outbound connections to non-standard ports are automatically blocked by the firewall. If you try to connect to a site running on an unusual port, it is likely that the connection will time out.
Hello, Dead-i! Thank you for answer!
I think this is the problem. How to fix it?
 

Dead-i

x10Hosting Support Ninja
Community Support
Messages
6,084
Reaction score
368
Points
83
Hi,

Unfortunately, we can't disable the firewall for individual users, and there is no way around this if you need to connect to port 7020. However, it is unusual for websites to ask you to do this. You would need to connect to a website on a standard port (such as port 80). It looks like "ipgeobase.ru" is an IP lookup service; could you use a different service to do this, perhaps? :)

Thank you,
 
Status
Not open for further replies.
Top