PHP - opening a socket to a ventrilo server

Rolus

New Member
Messages
9
Reaction score
0
Points
0
Ventrilo released some php software to check on server or channel status (so you can see who's in the channel on your webpage). Problem is that it requests the information via an executable which needs to be on the same server as the voice server.
Yesterday i came across an alternative: apparently some1 cracked the ventrilo protocol encoder and written his own version the ventrilo status script in C which some other guy adapted for php. With this script you don't need to have access to the ventrilo executable at all and you can just check the status of any server you like as long as you have the password. So i played around with the php-script a bit and it worked like a charm on my pc. However, when i uploaded to x10hosting i got a blank page and after setting my script to display notices i saw the problem:

NOTICE: fwrite() [function.fwrite]: send of 36 bytes failed with errno=1 Operation not permitted

The code responsible should be:
Code:
$sfh = fsockopen( "udp://$ip", $port, $errno, $errstr );

    if ( !$sfh ) {
    echo("Socket Error: $errno - $errstr\n");
    return false;
    }
    fwrite( $sfh, $request->packet );
Where $request->packet is the encoded request.
I'm not at all familiar with socketting other servers with php so i did some searching on the internet. I found some forums where it was suggested it could be caused by the server firewall blocking the port im using (x10hostings firewall, not the vent server). Im trying to connect to a vent server on port 33300. I don't get the socket error however so i guess that i did get a connection.
Does any1 know what causes this? Could it be the firewall? If not, how can i get it working?

thx in advance
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
fsockopen() is denied to all users at the moment. It will be available if you get PHP V3, but I doubt you will. They are very strict on V3 and it is very hard to get. Also, since you are using reverse-engineered software, I would be very very careful. You may be in violation of X10's TOS.
 

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
fsockopen() is denied to all users at the moment. It will be available if you get PHP V3, but I doubt you will. They are very strict on V3 and it is very hard to get. Also, since you are using reverse-engineered software, I would be very very careful. You may be in violation of X10's TOS.

No TOS violation from what I can see - Ventrilo's site has no Terms of Use on it (I'm assuming it's inside the app itself), but just like a video game server, it seems Ventrilo is designed to report some information back if queried specifically.

Plus Ventrilo's Public 3.0 server is free, so it's not reverse-engineered paid software, and Ventrilo's own site has a similar app - you enter the hostname/port and it queries it for information.


Should be fine on the Reverse-Engineering front, but V3'll be exactly like you said - hard as heck to get, even once the version system is back up (everyone's on a default php config right now).
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
@Livewire - that's true, I forgot it was free for the server too. I don't know what the licensing is on it though. That could make a difference.

Regardless, as livewire said, you probably won't be able to accomplish this without fsockopen() which is a far shot, in my opinion.
 
Top