[Icecast] Windows Xp / Icecast 2.3.1 / Oddcast 3 / Crap Router?

Bill Duffy icecast at wooba.org
Sun Apr 30 19:47:30 PDT 2006


Belated response to this thread I know. I had a similar problem with 
icecast on local LAN vs remote when authentication was in use. When I 
was not using auth my stream worked fine either remotely or locally. 
With auth on, I could not access the stream remotely. Taking a look at 
the m3u files generated with auth off vs auth on I noticed a difference. 
With auth on, the file contained the hostname of the box that icecast 
sits on on my LAN - one that will never work remotely. With auth off, 
the file contained the hostname of my firewall which allowed port 
forwarding to work correctly. I imagine playing around with the icecast 
hostname setting could have made this work remotely without too much 
trouble.

Took a look at the code and it turns out there is a difference in how 
the hostname for the m3u file is generated depending on whether auth is 
in use or not. The attached patch chances admin.c to generate the 
hostname with auth on in a way that parallels that with auth off. Tested 
on Linux Slackware and nowhere else ;-)

May be a good reason the code works the way it does though? I don't know 
much about icecast beyond how to set it up - just thought I would point 
this out and give someone a hint on how to fix it if necessary.

Cheers,

Bill

Leo Currie wrote:
> Autoegocrat wrote:
>>
>>
>> Ok here's the deal. I set up Icecast and Oddcast, got them to 
>> communicate
>> properly, but cannot access the live audio remotely. On other 
>> computers in
>> the LAN it works perfetly. Currently I operate wirelessly behind a 
>> D-Link
>> 514 router (a mite outdated by now, yes?) and have opened all necessary
>> ports, turned my firewalls off, set this computer as a DMZ, pretty much
>> everything I can think of - but when I try to connect from outside 
>> the LAN,
>> I still get a timeout message. I've check the access logs and ity 
>> does not
>> show any record of a connection attempt. Perhaps this is a problem 
>> that is
>> in a different league than icecast config, but you guys are smarter 
>> than I.
>> Help me out? heh
>>
>
> All that should be necessary to access the stream from the world is to 
> open and forward the correct port on your router.
>
> I was looking at this page:
> http://support.dlink.com/faq/view.asp?prod_id=1005#604
> ..and it looks pretty straightforward, just click enable, name it 
> something like "icecast", punch in the local IP of the machine on the 
> LAN running Icecast, then the port it's running on twice (i.e. public 
> & private the same), then click always, then apply. You shouldn't need 
> to bother with any DMZ stuff or turning off firewalls.
>
> You haven't by any chance got 2 lans, one wired, one wireless, and 
> accidentally binded Icecast only to the wired nic, have you?
> Just a thought...!
>
> Leo
> _______________________________________________
> Icecast mailing list
> Icecast at xiph.org
> http://lists.xiph.org/mailman/listinfo/icecast
>
-------------- next part --------------
--- admin.old	2005-09-12 22:50:48.000000000 +0000
+++ admin.c	2006-05-01 21:03:13.000000000 +0000
@@ -685,17 +685,34 @@
 
     client->respcode = 200;
     config = config_get_config();
-    snprintf (client->refbuf->data, PER_CLIENT_REFBUF_SIZE,
-        "HTTP/1.0 200 OK\r\n"
-        "Content-Type: audio/x-mpegurl\r\n"
-        "Content-Disposition = attachment; filename=listen.m3u\r\n\r\n" 
-        "http://%s:%s@%s:%d%s\r\n",
-        username,
-        password,
-        config->hostname,
-        config->port,
-        source->mount
-    );
+    char *host = httpp_getvar (client->parser, "host");
+    if (host && strchr (host, ':') == NULL)
+        host = NULL;
+    if (host == NULL) {
+        snprintf (client->refbuf->data, PER_CLIENT_REFBUF_SIZE,
+            "HTTP/1.0 200 OK\r\n"
+            "Content-Type: audio/x-mpegurl\r\n"
+            "Content-Disposition = attachment; filename=listen.m3u\r\n\r\n"
+            "http://%s:%s@%s:%d%s\r\n",
+            username,
+            password,
+            config->hostname,
+            config->port,
+            source->mount
+        );
+    }
+    else {
+        snprintf (client->refbuf->data, PER_CLIENT_REFBUF_SIZE,
+            "HTTP/1.0 200 OK\r\n"
+            "Content-Type: audio/x-mpegurl\r\n"
+            "Content-Disposition = attachment; filename=listen.m3u\r\n\r\n"
+            "http://%s:%s@%s%s\r\n",
+            username,
+            password,
+            host,
+            source->mount
+        );
+    }
     config_release_config();
 
     client->refbuf->len = strlen (client->refbuf->data);


More information about the Icecast mailing list