Hi,
I have an application that streams audio/video over UDP to xxx.xxx.xxx.xxx:xxxx. Since UDP is connectionless, if the client is behind a router/firewall, there is no way he will be able to watch the stream without configuring the router itself. In theory, a way to enable it would be for the client to initiate and send UDP packets to the server on xxxx port. To keep the connection alive, send packets every 5 seconds or so.
I know this can be done using a Java applet, but for the sake of consistency I would love to do in PHP. I am convinced this is possible but would like to have advices from people who might have done it already, or have ideas as to where to start.
Thanks in advance,
Jerome
Creating a two-way dynamic rule to allow UDP traffic
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
fsockopen() after using stream_get_transports() <- (requires PHP 5) to determine if your install of php supports udp first.
[edit]
if you look toward the bottom of the manual page on fsockopen, they have a UDP example even.
[edit]
if you look toward the bottom of the manual page on fsockopen, they have a UDP example even.