| View previous topic :: View next topic |
| Author |
Message |
dards
Joined: 01 Mar 2011 Posts: 23 Location: Dubai
|
Posted: Wed Mar 09, 2011 6:01 am Post subject: icecast2 KH on VPS port 80 |
|
|
Hi all,
I am trying to set icecast KH on port 80 on my Linux VPS, what I did was:
* move the apache (httpd) to different port
* run icecast on port 8064 with mount point /live
* run iptables command to re-route port 80 to 8064
iptables -A PREROUTING -t nat -p tcp -d 75.xx.xxx.xx --dport 80 -j REDIRECT --to-port 8064
* start my dsp client to stream AAC+ on the vps server, everything is working fine it works on winamp when I tried to listen http://mydomain.com/live
The problem is:
My Flash AAC+ player cannot play it using http://mydomain.com/live?type=.flv it appears just loading... , but works perfectly when I used the original port http://mydomain.com:8064/live?type=.flv
Action:
I tried to view the stream using SmartSniff and this is what I found
Stream from original port 8064 (this works fine)
---server response-----------------------------------------------------------
HTTP/1.0 200 OK
content-type: video/x-flv
Cache-Control: no-cache
Expires: Thu, 01 Jan 1970 00:00:01 GMT
Pragma: no-cache
FLV..... .................
onMetaData.......name...This is my server name..description...This is my server description..stereo....audiosamplerate.@.......
Stream from original port 80 (this not working)
---server response-----------------------------------------------------------
HTTP/1.1 200 OK
content-type: video/x-flv
Cache-Control: no-cache
Expires: Thu, 01 Jan 1970 00:00:01 GMT
Pragma: no-cache
Transfer-Encoding: chunked
Connection: Keep-Alive
Age: 0
Date: Wed, 09 Mar 2011 05:30:59 GMT
EC
FLV..... .................
onMetaData.......name...This is my server name..description...This is my server description..stereo....audiosamplerate.@........
Findings:
As you notice there is an extra data before the FLV mark "EC" but on the original stream that is working there is no extra data before the FLV, I'm sure this one causes the Flash player to not play the AAC+ stream.
Other work around:
By the way I also tried to directly run icecast on port 80, not use any re-routing or forwarding, but the problem is my dsp client cannot connect to the icecast even the mount password is correct I'm not sure what is the problem.
Hope somebody can share information here.
thanks |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Wed Mar 09, 2011 12:50 pm Post subject: |
|
|
try getting a non-flv stream from port 80 and check for the server header. I suspect you are getting content from apache still as headers like
Transfer-Encoding: chunked
are not from icecast. you may need to restart the apache and check the netstat -tnlp output for which processes are listening to the ports.
karl. |
|
| Back to top |
|
 |
dards
Joined: 01 Mar 2011 Posts: 23 Location: Dubai
|
Posted: Wed Mar 09, 2011 2:41 pm Post subject: |
|
|
Hi KarlH, Wow! its an honor talking to the creator of icecast KH congratulations to the job well done.
With regards to your suggestion, I followed it and here below is the output
=========== NONE FLV Stream , player is winamp works fine ====
HTTP/1.1 200 OK
Content-Type: audio/aacp
icy-br:44
ice-audio-info: ice-samplerate=44100;ice-bitrate=44;ice-channels=2
icy-br:44
icy-description:This is my server description
icy-genre:Rock
icy-name:This is my server name
icy-private:0
icy-pub:1
icy-url:http://www.oddsock.org
Server: Icecast 2.3.2-kh29
Cache-Control: no-cache
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Pragma: no-cache
icy-metaint:16000
Connection: close
Date: Wed, 09 Mar 2011 13:56:10 GMT
..\@....T6,4.+...d.9.fT....V..@9>...M.K...L..N..n.j!.zX....R..
*7..n......x.u.s1..X....2.o.X.4.jo?....1.....1.1).;....;....w......X..Le]5.
==== another try with flv stream using winamp (works fine)======
HTTP/1.1 200 OK
content-type: video/x-flv
Cache-Control: no-cache
Expires: Thu, 01 Jan 1970 00:00:01 GMT
Pragma: no-cache
Connection: close
Date: Wed, 09 Mar 2011 13:51:16 GMT
FLV..... .................
onMetaData.......name...This is my server name..description...This is my server description..stereo....audiosamplerate.@........
audiodatarate.@F........audiocodecid.@$
====== at this time with flash player (not working) ==========
HTTP/1.1 200 OK
content-type: video/x-flv
Cache-Control: no-cache
Expires: Thu, 01 Jan 1970 00:00:01 GMT
Pragma: no-cache
Transfer-Encoding: chunked
Connection: Keep-Alive
Date: Wed, 09 Mar 2011 13:52:19 GMT
9
FLV.....
100
.................
onMetaData.......name...This is my server name..description...This is my server description..stereo
I also disabled the apache (service httpd stop) to make sure that apache is not responsible for the response
result for netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 6036/mysqld
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 15879/sendmail: acc
tcp 0 0 :::22 :::* LISTEN 15829/sshd
tcp 0 0 :::8064 :::* LISTEN 5460/icecast
tcp 0 0 :::8065 :::* LISTEN 5460/icecast
I suspected that Transfer-Encoding: chunked is the one that cause this error.
My question is how can I disabled the Transfer-Encoding: chunked on icecast KH
kind regards, |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Wed Mar 09, 2011 3:18 pm Post subject: |
|
|
You don't because neither trunk or kh icecast has a chunked transfer facility. If you are getting that header then it's from something else, either passed through from the source client, unlikely if FLV is working via the higher port number, or port 80 is actually going to something else like a proxy or apache. Can you try getting the index.html or status.xsl page via port 80?
karl. |
|
| Back to top |
|
 |
dards
Joined: 01 Mar 2011 Posts: 23 Location: Dubai
|
Posted: Thu Mar 10, 2011 4:27 am Post subject: |
|
|
Hi KarlH,
Yes, it can also serve index.html or status.xsl as you can see here
http://75.75.226.63/index.html
http://75.75.226.63/status.xsl
the port 80 is just rerouted to port 8064
My observation is that it when I use winamp with flv such as:
http://75.75.226.63/live?type=.flv
and view the stream, Transfer-Encoding: chunked is not there, this means that the server detects the listening client and set the transfer-encoding depend on the type of client, but why is it that when using the higher port 8064 the server does not chunked the stream but when using the port 80 it chunked the stream.
Thanks for your help,
dards |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Thu Mar 10, 2011 4:56 am Post subject: |
|
|
I've just tried here with that url (on port 80) and I do not see the Transfer-Encoding header which is what I would expect from icecast. mplayer here works on that stream as flv or adts.
karl. |
|
| Back to top |
|
 |
dards
Joined: 01 Mar 2011 Posts: 23 Location: Dubai
|
Posted: Thu Mar 10, 2011 5:13 am Post subject: |
|
|
Winamp, vlc and other player handle this chunked encoding so they can play the stream normally, I tried here with vlc and its working fine even when I check the stream, the chunked is there
============= stream trace =====================
GET /live?type=.flv HTTP/1.1
Host: 75.75.226.63
User-Agent: vlc/1.1.6
Range: bytes=0-
Icy-MetaData: 1
HTTP/1.1 200 OK
content-type: video/x-flv
Cache-Control: no-cache
Expires: Thu, 01 Jan 1970 00:00:01 GMT
Pragma: no-cache
Transfer-Encoding: chunked
Connection: Keep-Alive
Date: Thu, 10 Mar 2011 05:07:38 GMT
FF
FLV..... .................
onMetaData.......name...This is my server name..description...This is my server description..stereo....audiosamplerate.@........
audiodatarate.@F
But the flash player I think cannot handle this and did not play the stream.
thanks for quick response |
|
| Back to top |
|
 |
dards
Joined: 01 Mar 2011 Posts: 23 Location: Dubai
|
Posted: Thu Mar 10, 2011 9:52 am Post subject: |
|
|
Hi KarlH,
I found out that when I try the flash to listen on port 8064 the icecast response with HTTP/1.0 and flash can play the stream as normal
GET /live?type=.flv HTTP/1.1
Accept: */*
Accept-Language: en-US
Referer: http://localhost/player.swf?r=4781
x-flash-version: 10,1,53,64
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; WOW64; SV1; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Host: 75.75.226.63:8064
Connection: Keep-Alive
HTTP/1.0 200 OK
content-type: video/x-flv
Cache-Control: no-cache
Expires: Thu, 01 Jan 1970 00:00:01 GMT
Pragma: no-cache
FLV..... .................
-----------------------------------------------------------------------
But when I tried the flash player to listen on the port 80 the icecast respose with HTTP/1.1
GET /live?type=.flv HTTP/1.1
Accept: */*
Accept-Language: en-US
Referer: http://localhost/player.swf?r=1825
x-flash-version: 10,1,53,64
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; WOW64; SV1; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Host: 75.75.226.63
Connection: Keep-Alive
HTTP/1.1 200 OK
content-type: video/x-flv
Cache-Control: no-cache
Expires: Thu, 01 Jan 1970 00:00:01 GMT
Pragma: no-cache
Transfer-Encoding: chunked
Connection: Keep-Alive
Date: Thu, 10 Mar 2011 09:49:43 GMT
F0
FLV..... .................
onMetaData.......name...This is
apache was turned off during that test , which means header is surely from icecast server. |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Thu Mar 10, 2011 11:27 am Post subject: |
|
|
well I just tried using netcat with those exact headers against the specified IP port 80 and received
| Quote: |
HTTP/1.0 200 OK
content-type: video/x-flv
Cache-Control: no-cache
Expires: Thu, 01 Jan 1970 00:00:01 GMT
Pragma: no-cache
|
followed by flv content. As you can see the response headers Data, Connection and Transfer-Encoding do not get sent. your flv content however seems corrupted because you have A F0 initially.
A couple of things to try out, run
curl -o /dev/null -v http://75.75.226.63/live?type=.flv
mplayer http://75.75.226.63/live?type=.flv
if you have a url where we can run a flash player getting the content then I could try the flash player here. I'm assuming you are using something like wireshark to capture the packets.
karl. |
|
| Back to top |
|
 |
dards
Joined: 01 Mar 2011 Posts: 23 Location: Dubai
|
Posted: Thu Mar 10, 2011 12:25 pm Post subject: |
|
|
Hi KarlH,
This is confusing, I try also fidler and throw the same header but it reply the same with http/1.1 and Transfer-Encoding: chunked is there,
Anyways here are the test flash players:
This one use higher port address 8064 which work fine
http://s03.whooshstream.net/player/player.php
This one used port 80 which response is chunked and player does not work
http://s03.whooshstream.net/player2/player.php
Thank you for helping |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Thu Mar 10, 2011 1:47 pm Post subject: |
|
|
would it be annoying if I said that the flash player (player2) worked here, playback, graphics, timer etc
| Quote: |
GET /live?type=.flv HTTP/1.1
Host: s01.whooshstream.com
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.2.13) Gecko/20101212 Remi/fc12 Firefox/3.6.13
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en,en-us;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: UTF-8,*
Keep-Alive: 115
DNT: 1
Connection: keep-alive
HTTP/1.0 200 OK
content-type: video/x-flv
Cache-Control: no-cache
Expires: Thu, 01 Jan 1970 00:00:01 GMT
Pragma: no-cache
|
Are you sure there's no browser caching going on?
karl. |
|
| Back to top |
|
 |
dards
Joined: 01 Mar 2011 Posts: 23 Location: Dubai
|
Posted: Thu Mar 10, 2011 5:42 pm Post subject: |
|
|
Hi karlh,
I tested here at the office also to my pc at home but only the first player work, anyway if that the case that both players are working on your side then this can be concluded on the ISP side here, I think they are modifying header for port 80.
Anyway thanks for your time, consider this problem as solved, once again congratulation for the great work on icecast KH as it make possible to stream AAC+ directly to flash. |
|
| Back to top |
|
 |
netandino
Joined: 08 Feb 2011 Posts: 5 Location: Peru
|
Posted: Mon Mar 21, 2011 6:49 am Post subject: |
|
|
By the way, taking the opportunity to ask the following.
I have a icecast installed on multiple servers and VPS as evidence but all in centos 5, I saw that generates many logs me this is annoying. since I do run with it mediacontrolpanel centovacast and to see the actual statistics of traffic and the use of GeoIP GeoMap
I like to know how do I disable the creation of logs, and that one day I generate about 20 to 50 mbs of logs: ( _________________ Creando Nuevas Soluciones |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Mon Mar 21, 2011 4:25 pm Post subject: |
|
|
you should be able to use /dev/null
karl. |
|
| Back to top |
|
 |
|