PDA

View Full Version : Sending UDP from webaccount



ares23
04-04-2008, 11:04 AM
Hey there,

We have a Bluehost web account which we're building a service on that requires UDP packets to be sent.

I put together the following test script to see if such a thing was possible:


#!/usr/bin/perl

print "Content-type: text/plain\n\n";

use IO::Socket;
$handle = IO::Socket::INET->new(Proto => 'udp') or die "socket: $@";

$PORTNO = 4767;
$HOSTNAME = "89.10.14.81";

$ipaddr = inet_aton($HOSTNAME);
$portaddr = sockaddr_in($PORTNO, $ipaddr);
$res = send($handle, "123thisisjustatest", 0, $portaddr) or print "cannot send: $!\n";
print "sent $res\n";

The script seems to run ok, but the send() operation fails with "Operation not permitted". I presume this is a security precaution (although the packet is sent on a port higher than 1024).

Does anyone know why this wouldn't work on Bluehost? Is this something we have to ask for permission to do, etc?

Thanks,

Ares.

felgall
04-04-2008, 03:03 PM
BlueHost have all the ports that a website doesn't normally need closed by default. Presumably this would include all the UDP ports since a web site doesn't normally use those.

If you have a dedicated IP address then one of the extra options that gives is the ability to open additional ports. I am not sure if that includes the UDP ones or not though. You'd probably do best to ask BlueHost support.

ares23
04-04-2008, 07:26 PM
Ok, thanks for the help felgall.