<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>haproxy &#8211; Virtually Fun</title>
	<atom:link href="https://virtuallyfun.com/category/haproxy/feed/" rel="self" type="application/rss+xml" />
	<link>https://virtuallyfun.com</link>
	<description>Fun with Virtualization</description>
	<lastBuildDate>Fri, 11 Apr 2025 18:37:52 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.2</generator>
	<item>
		<title>Enjoying some Real Audio on a working Friday</title>
		<link>https://virtuallyfun.com/2025/04/11/enjoying-some-real-audio-on-a-working-friday/</link>
					<comments>https://virtuallyfun.com/2025/04/11/enjoying-some-real-audio-on-a-working-friday/#comments</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Fri, 11 Apr 2025 18:37:52 +0000</pubDate>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[haproxy]]></category>
		<category><![CDATA[Internet]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/?p=15263</guid>

					<description><![CDATA[I have some old stuff transcoded to Real Audio, because why not? It&#8217;s like a magical hidden file-format from years past. Granted the streaming software is so old, it breaks with NAT, but there was an older playable RAM / &#8230; <a href="https://virtuallyfun.com/2025/04/11/enjoying-some-real-audio-on-a-working-friday/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">I have some old stuff transcoded to Real Audio, because why not?  It&#8217;s like a magical hidden file-format from years past.</p>



<p class="wp-block-paragraph">Granted the streaming software is so old, it breaks with NAT, but there was an older playable RAM / playlist file that&#8217;d just pull down .ra&#8217;s from a web server, like a snap.  Except I never could get it to work right, but I didn&#8217;t spend much energy on it, because who cares?</p>



<figure class="wp-block-image size-full"><img decoding="async" width="776" height="61" src="https://virtuallyfun.com/wp-content/uploads/2025/04/image.png" alt="" class="wp-image-15264" srcset="https://virtuallyfun.com/wp-content/uploads/2025/04/image.png 776w, https://virtuallyfun.com/wp-content/uploads/2025/04/image-300x24.png 300w, https://virtuallyfun.com/wp-content/uploads/2025/04/image-768x60.png 768w, https://virtuallyfun.com/wp-content/uploads/2025/04/image-500x39.png 500w" sizes="(max-width: 776px) 100vw, 776px" /><figcaption class="wp-element-caption">GET /DSOTM.ram</figcaption></figure>



<p class="wp-block-paragraph">Well I went for it today, hooked up some tcpdump after getting the stupid &#8216;error 11&#8217; and yeah, turns out that even the 3.0 client is HTTP 1.0.  So that means it doesn&#8217;t use named servers, so you can&#8217;t really put it on a modern web server.  It&#8217;s bad enough it doesn&#8217;t like modern cryptography, but this is just the worst.  So I figured I&#8217;d just try to do something raw as I&#8217;m also kinda annoyed that I can&#8217;t have good old HTTP access to my vpsland archive, since google will penalize you for having HTTP sites/links.  But a $1 VPS and a $1 domain, and I&#8217;m in business.</p>



<p class="wp-block-paragraph">The first thing I went to do was to setup haproxy to front all this, as I like to use all kinds of weird backends, like UnixWare, or Windows NT 3.1</p>



<pre class="wp-block-code"><code>+
+frontend http8888
+        bind *:8888
+        mode http
+        http-request set-header Connection "keep-alive" if { req.ver "1.0" }
+        http-request set-header Host "dsotm.rabbitfoxtrot.uk" if { req.ver "1.0" }
+
+        acl dsotm hdr(host) -i dsotm.rabbitfoxtrot.uk:8888
+        acl is_ra path_end .ra .RA
+        acl is_ram path_end .ram .RAM
+        use_backend dsotm if dsotm || is_ra || is_ram
+
+backend dsotm
+        balance leastconn
+        option httpclose
+        option forwardfor
+        server local1 127.0.0.1:80 check inter 500 maxconn 20
a</code></pre>



<p class="wp-block-paragraph">This diff is for the /etc/haproxy/haproxy.conf which simply adds an 8888 front end.  I set it to add a &#8216;keep-alive&#8217; &amp; &#8216;Host&#8217; fields in the header to start to make it seem a bit right.</p>



<p class="wp-block-paragraph">Next it will parse out the extension of what files are being retrieved.  More magic would be needed to do multiple RealAudio&#8217;s in that different paths/trees for sure, but since this is the only one on that front end, just looking for the .ra/.ram is enough.  I could also attach other sites to that front end, dancing around this, but that&#8217;s a bit more work.  </p>



<p class="wp-block-paragraph">that&#8217;ll attach a name, in this case dsotm.rabbitfoxtrot.uk, and then shove it to the local Apache server which I&#8217;ve moved to the loopback adapter.</p>



<p class="wp-block-paragraph">Configuring Apache is a bit more involved with all the moving parts:</p>



<p class="wp-block-paragraph">ports.conf</p>



<pre class="wp-block-code"><code>--- ports.conf.dist     2025-04-11 17:28:47.627256671 +0000
+++ ports.conf  2025-04-11 17:28:58.374176767 +0000
@@ -2,7 +2,7 @@
 # have to change the VirtualHost statement in
 # /etc/apache2/sites-enabled/000-default.conf

-Listen 80
+Listen 127.0.0.1:80

 &lt;IfModule ssl_module>
        Listen 443</code></pre>



<p class="wp-block-paragraph">The whole point is to make Apache listen on the loopback interface, not the public address.  This way haproxy gets the requests first so it can alter/direct them as needed.</p>



<p class="wp-block-paragraph">The final part, which combines the MiME magic, is contained in the sites-availble directory which then of course is linked to the sites-enabled</p>



<pre class="wp-block-code"><code>&lt;VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        ServerName dsotm.rabbitfoxtrot.uk

        ServerAdmin abuse@rabbitfoxtrot.uk
        DocumentRoot /srv/www/vpsland/low/DSOTM

        AddType audio/x-pn-realaudio            ram
        AddType audio/x-pn-realaudio-plugin     rpm
        AddType audio/x-realaudio               ra

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error/dsotm-error.log
        CustomLog ${APACHE_LOG_DIR}/dsotm-access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
    &lt;Directory /srv/www/vpsland/low/DSOTM>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
    Order allow,deny
    allow from all
    Require all granted
    &lt;/Directory>
&lt;/VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet</code></pre>



<p class="wp-block-paragraph">So now I can still host a half dozen other websites on that Apache server but also have that special &#8216;front door&#8217; access on port 8888 that&#8217;ll take notice of requests for .ra/.ram files and it&#8217;ll transform those into something more HTTP 1.1 which Apache will enjoy.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img fetchpriority="high" decoding="async" width="381" height="481" src="https://virtuallyfun.com/wp-content/uploads/2025/04/image-1.png" alt="" class="wp-image-15265" srcset="https://virtuallyfun.com/wp-content/uploads/2025/04/image-1.png 381w, https://virtuallyfun.com/wp-content/uploads/2025/04/image-1-238x300.png 238w" sizes="(max-width: 381px) 100vw, 381px" /><figcaption class="wp-element-caption">Playing!</figcaption></figure>
</div>


<p class="wp-block-paragraph">And even better, it works.</p>



<p class="wp-block-paragraph">At some point, like the boxed wine project we&#8217;ll hit the point where you can just 90&#8217;s internet 100% in the browser to other browser &#8216;server&#8217; nodes.  It&#8217;ll be awesome.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2025/04/11/enjoying-some-real-audio-on-a-working-friday/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
	</channel>
</rss>
