Outgoing ports open?


#1

I am looking for a new host - one that will support PHP code that contains socket opens (to talk to other web servers), at non-standard ports (such as 8080).

Example: http://209.204.213.124/u.php - when viewed from a browser, should have first line saying "Success!"
The php code for that can be seen at:
http://209.204.213.124/u.txt

Can someone who has the “Level 1” program at DreamHost (with non-unique IP address) tell me if that PHP code will work on their site?

I would really appreciate it if you can copy over the u.txt file to a u.php file on your server, and then go to web browser to visit that page, and tell me if it says “Success” or "Could not contact…"
Or, if you know for sure whether outgoing ports are open for DreamHost servers. Note that I’m not asking about incoming ports - I know that only port 80 may be kept open for incoming requests, other ports may all be closed.

This tests whether the PHP code can eventually do things like: fopen(“http://${remotehost}:${remoteport}/test.txt”)
which reads a file from a remote web server, at remoteport.


#2

no, dream host has disabled remote fopen’s BUT you can use CURL to do the same thing!

<?php
$curl_handle=curl_init();
curl_setopt($curl_handle,CURLOPT_URL,'http://domain.com/path/to/file.ext');
curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,10);
curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);
$buffer = curl_exec($curl_handle);

curl_close($curl_handle);
print $buffer
?>

that will print the contents of the file file.ext its a little longer then fopen(http://domain.com/file.ext); but it also gives you more controle AND is safer to! hope that helps

Neo ns101.com