karlheyes / icecast-kh

KH branch of icecast
GNU General Public License v2.0
299 stars 107 forks source link

Icecast proxied by nginx metadata issue #239

Closed thuban-arrakis closed 4 years ago

thuban-arrakis commented 5 years ago

Hello, and first of all thank you for your work. I'am using Icecast 2.4.0-kh10-0-g8091762, proxied with nginx nginx version: nginx/1.15.3, both on same host, and i have an problem with now playing, genre tags, and so on. Here an example of VLC directly to icecast http through nginx-reverse-proxy https

Please, it gives me headache for two months.

Tremolo4 commented 5 years ago

Maybe your nginx proxy does not forward the metadata HTTP header? Icy-MetaData:1

thuban-arrakis commented 5 years ago
location /
  {
  root /usr/local/share/icecast/web/;
  **proxy_set_header          Icy-MetaData 1;**
  proxy_pass         http://127.0.0.1:8000/;
  chunked_transfer_encoding off;
  proxy_buffering off;
  proxy_redirect     off;
  proxy_set_header   Host             $host;
  proxy_set_header   X-Real-IP        $remote_addr;
  proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
 }

I use it that way, is this right place for Icy-MetaData:1?

Notice that my site.conf metadata header does not contain colon. Hmm. No, if i do with colon nginx says invalid number of arguments in "proxy_set_header" directive. And that's not all, if i set up proxy_set_header Icy-MetaData 1; my stream stops after 00:01 sec in Google Chrome, and most of all browsers except FireFox.

Tremolo4 commented 5 years ago

I'm not very familiar with nginx config, but that looks right to me. Apparently something else is missing. You could try using e.g. Wireshark to compare the HTTP headers of the direct stream and the proxied stream. You would need to disable encryption for now though, judging by the https://

thelan commented 5 years ago

Hello,

Actually i've also struggled with this problem. My conclusion was that the probleme is on the player side.

I have a quite similar setup:

When using ssl on vlc directly the metadata could not be parsed.

I've tested the "https proxying" using stunnel on my local box so the connexion is like this: VLC ==HTTP==> stunnel ==HTTPS==> Haproxy ==HTTP==> icecast

And so the metadata was correctly displayed on the player.

thuban-arrakis commented 5 years ago

Hi, it's me again. i'm also struggling with this one. Second - with bad Cyrillic charset (or Cyrillic encoding, idk), working as relay, Would be grateful for some help.

good bad

karlheyes commented 5 years ago

Add <charset> to <mount> to charset used. It was Latin1 by default but as most are utf8 now then it seems like a better option. non-ascii metadata was always a bit of a black art for metadata as most players did not specify the charset used so was kind of hit-and-miss, but the xsl pages have to allow for multiple types so utf8 is what is used there. So use <charset> in <mount> if you cannot specify charset= in the parameters to the admin call.

karl.

thuban-arrakis commented 5 years ago

Ok, I need to clarify a couple of points. The charset problem is observed when default version of ICECAST as master relaying to ICECAST-KH as slave. With the KH version, there is a problem with the Cyrillic charset only in the RELAY mode (stream relaying from the master ICECAST). Yes, <charset> UTF8 </ charset> can be specified at the mount point on the ICECAST master server, but it seems that other ICECAST operating in the RELAY mode ignores the <charset> settings in the masters stream. And in the RELAY settings there is no possibility to set a <charset>. Or it is, but I do not know about it?

karlheyes commented 4 years ago

charset is a mount option so you stioulate it there. One annoyance with icy streams is the lack of clarity on character sets, so it was never really defined. The charset tag as the charset parameter to admin were there to clear it up. One issue was that originally the dnas was single stream, single source so there was an assumption about what it should be but with icecast and many streams having different character sets meant utf8 was the single one used for stats and YP. It was never clear on whether that should be fed through to players or relays. Obviously times change and the assumptions may be altered so may be the charset should be applied to the metadata in-stream as well.

karl