Page 1 of 1

Podcast URL error

PostPosted: Wed Mar 09, 2011 10:18 pm
by Skidd
Hey, first of all, nice bit of software!
I haven't yet, but will be donating!

I have a small issue with the playlist/podcast feature.

I have subsonic running inside my firewall on a media dedicated machine. My firewall sends all port 80 requests to a DMZd Apache server.
this apache server is using mod_proxy to forward all requests to my media servers subsonic:4040 instance. Thus, I access subsonic externally without the need for port 4040 or the internal machines IP address.

I have a test play list with just two songs in it.
I can view the podcast no problem

Code: Select all
http://<my domain>/podcast.view


The items in the podcast have the wrong URL though.
The contain the full path to the internal server

Code: Select all
http://10.0.0.10:4040/stream?playlist=shane01.m3u&amp;suffix=.m4a


Instead of the valid URL of

Code: Select all
http://<my domain>/stream?playlist=shane01.m3u&amp;suffix=.m4a


Is there a setting I can tweak to have subsonic generate valid external URLs?

Cheers
Shane.

PostPosted: Fri Mar 11, 2011 5:34 pm
by Skidd
Wow.. not exactly over-flowing with input on this!!

I've at least found what value is incorrect.

The jsp page extracted by jetty
.../jetty/2169/webapps/WEB-INF/jsp/podcast.jsp
Appears to be the podcast template file.

${podcast.enclosureUrl}
and
${model.url}

Both have incorrect values for an external stream.
They contain the internal machines IP address.

It's sure be nice to try out the podcast feature of subsonic outside my firewall. Please, any easy way to override this URL error?

Shane

Re: Podcast URL error

PostPosted: Thu Dec 20, 2012 9:41 pm
by efpophis
Wow .. you posted this ages ago.

I just ran into this error today, and I came up with a couple ways around it. One is butt-ugly, the other one is more correct but reveals another issue.

The way you SHOULD be able to get around this error is by simply adding the line

Code: Select all
ProxyPreserveHost On


to your subsonic virtual host entry on your apache server. When I did that, the podcast URLs were generated correctly, BUT .. it reveals another error that I was not quite able to trace down. If you're not using SSL, then you won't notice. I like to have everything encrypted, so I noticed.

With this on, and apache set up to server your subsonic stuff over SSL, but with plain old http backend to subsonic, I kept getting a warning that every page was displaying insecure content. Upon further investigation, I noticed the exact warning was "the page at about:blank displayed insecure content from http://my.host.net/home.view" .. Try as I might, I could not get rid of this warning as long as ProxyPreserveHost was set to On.

So, what's an anal-retentive programmer to do? Use the source, that's what. I actually modified the subsonic source where it generates the podcast URLs and allowed it to look for a custom header in the http(s) request called "Subsonic-Podcast-Base-URL" or something like that. I then used the RequestHeader directive in my apache config to "hard-code" that header to "https://my.host.net", and turned ProxyPreserveHost back off.

So, now I have correct podcast URLs AND no annoying insecure content warnings. Life is good .. but it would be nice if the real subsonic dev could fix whatever the heck that is so that ProxyPreserveHost On would work and be the only fix you'll ever need.

Good luck! And of course, if you have come up with a better solution, please post it :)