+ Reply to Thread
Results 1 to 6 of 6

Thread: PHP - opening a socket to a ventrilo server

  1. #1
    Rolus is offline x10Hosting Member Rolus is an unknown quantity at this point
    Join Date
    Feb 2008
    Posts
    9

    Question PHP - opening a socket to a ventrilo server

    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

  2. #2
    Shadow121's Avatar
    Shadow121 is offline x10 Lieutenant Shadow121 is an unknown quantity at this point
    Join Date
    Jul 2006
    Location
    Centerville
    Posts
    455

    Re: PHP - opening a socket to a ventrilo server

    try just:
    PHP Code:
    fsockopen($ip$port$errno$errstr); 

  3. #3
    Rolus is offline x10Hosting Member Rolus is an unknown quantity at this point
    Join Date
    Feb 2008
    Posts
    9

    Re: PHP - opening a socket to a ventrilo server

    That just gives a connection error im afraid : /

    Btw, the original files can be found at http://aluigi.altervista.org/papers.htm#ventrilo Its the php porting of the Ventrilo Status Viewer 0.1

  4. #4
    garrettroyce's Avatar
    garrettroyce is offline Generally Helpful Member garrettroyce is a glorious beacon of lightgarrettroyce is a glorious beacon of light
    Join Date
    Apr 2008
    Location
    IL, USA
    Posts
    3,746

    Re: PHP - opening a socket to a ventrilo server

    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.
    gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer

  5. #5
    Livewire's Avatar
    Livewire is offline Abuse Compliance Officer Livewire is a glorious beacon of lightLivewire is a glorious beacon of light
    Join Date
    Jun 2005
    Location
    Behind a keyboard.
    Posts
    8,998

    Re: PHP - opening a socket to a ventrilo server

    Quote Originally Posted by garrettroyce View Post
    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).


    TOS breakers will be suspended regardless of race, creed, national origin, hair color, or favorite food. Thanks for your understanding!

  6. #6
    garrettroyce's Avatar
    garrettroyce is offline Generally Helpful Member garrettroyce is a glorious beacon of lightgarrettroyce is a glorious beacon of light
    Join Date
    Apr 2008
    Location
    IL, USA
    Posts
    3,746

    Re: PHP - opening a socket to a ventrilo server

    @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.
    gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer

+ Reply to Thread

Similar Threads

  1. tons of PHP Resources
    By Chris S in forum Scripts & 3rd Party Apps
    Replies: 10
    Last Post: 01-16-2009, 10:07 AM
  2. Free Teamspeak2 Virtual Private Server (VPS)
    By lokiklown in forum Gamer's Lounge
    Replies: 8
    Last Post: 01-03-2009, 06:12 PM
  3. X10hosting - Web server software ERROR
    By beisan-net in forum Scripts & 3rd Party Apps
    Replies: 1
    Last Post: 06-01-2008, 07:57 PM
  4. samba server issue
    By hopper in forum Computers & Technology
    Replies: 2
    Last Post: 04-13-2008, 10:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers