Friday, April 29, 2022

Forward LMS to the net

I have a LMS installation at home and a shoutcast music stream public-ally available. Sometimes I want to join some friends online and allow them to queue music up from my LMS into the shoutcast stream.

I use darkice to stream what I'm listening to up to a shoutcast server. And then I forward the http of my LMS install to an intermediary host with this command:


ssh -R 8081:localhost:9000 -p 23 richard@my-intermediary-host.com


Then, on my-intermediary-host, I set up an apache proxy, and add in basic http auth to stop folks chancing apon it.


Listen 8008
<VirtualHost *:8008>
    ProxyPreserveHost On

    # Servers to proxy the connection, or;
    # List of application servers:
    # Usage:
    # ProxyPass / http://[IP Addr.]:[port]/
    # ProxyPassReverse / http://[IP Addr.]:[port]/
    # Example:
    ProxyPass / http://0.0.0.0:8081/
    ProxyPassReverse / http://0.0.0.0:8081/
    <Proxy *>
        Order deny,allow
        Allow from all
        Authtype Basic
        Authname "Password Required"
        AuthUserFile /etc/httpd/.htpasswd
        Require valid-user
    </Proxy>
</VirtualHost>

The next step here is to avoid using darkice and probably use LMS's mp3 streaming output to plug directly into shoutcast... probably using ssh forwarding for that as well.

No comments: