<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title><![CDATA[The Open Source LAN Project]]></title>
  <link href="http://opensourcelan.com/atom.xml" rel="self"/>
  <link href="http://opensourcelan.com/"/>
  <updated>2017-02-19T08:28:39+00:00</updated>
  <id>http://opensourcelan.com/</id>
  <author>
    <name><![CDATA[Chris Holman]]></name>
    
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <entry>
    <title type="html"><![CDATA[Containing Your Game Servers - Docker and Game Servers]]></title>
    <link href="http://opensourcelan.com/blog/2017/01/28/containing-your-game-servers/"/>
    <updated>2017-01-28T10:28:52+00:00</updated>
    <id>http://opensourcelan.com/blog/2017/01/28/containing-your-game-servers</id>
    <content type="html"><![CDATA[<p><strong>Updated 2017-02-19 to include build process optimisations</strong></p>

<p>Over recent history, we&rsquo;ve been updating our <a href="https://github.com/OpenSourceLAN/gameservers-docker">gameservers-docker</a> repository with some useful dockerfiles. Many are still a work in progress, but all are usable. Let&rsquo;s take a walk through some examples to see the utility of this approach.</p>

<h3>tl;dr</h3>

<p>Get a game server with no effort.</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
</pre></td><td class='code'><pre><code class=''><span class='line'># Do these once to set up the image
</span><span class='line'>git clone https://github.com/OpenSourceLAN/gameservers-docker.git .
</span><span class='line'>
</span><span class='line'># Download the prop hunt map packs (this is not auto-downloaded because
</span><span class='line'># of its size and you may want a different map pack)
</span><span class='line'>wget --output-document tf2-prophunt/PHMapEssentialsBZ2.7z\
</span><span class='line'> https://github.com/powerlord/sourcemod-prophunt/releases/download/maps/PHMapEssentialsBZ2.7z
</span><span class='line'>
</span><span class='line'>./build.sh tf2-prophunt
</span><span class='line'>
</span><span class='line'># Do this every time you need to start an additional
</span><span class='line'>./start_server tf2-prophunt</span></code></pre></td></tr></table></div></figure>


<p>Almost all resources are automatically downloaded (eg, steamcmd, sourcemod) and so
no action is needed from you to download them. There are a handful of files that
we chose not to auto-download for various reasons. The build scripts will not
let you build without them, so you can&rsquo;t accidentally miss them.</p>

<h3>Building the image</h3>

<p>First we need to build our images. Let&rsquo;s build a TF2 prophunt image first.</p>

<p>The images are built in a heirachy. <code>base</code> is the common ancestor of all of our images, so that comes first.
If you try and build a descendant image and a dependency is not already built, the script will build it for you.</p>

<p>In this tutorial, we will do it the long and hard way so that you understand how it is structured.</p>

<p>All of the folders in the repository have a <code>build.sh</code> file. <code>cd</code> in to <code>base</code> and run <code>./build.sh</code>. Alternatively,
you can use <code>build.sh</code> in the root of the repository and pass an image name to the script as an argument.</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
<span class='line-number'>16</span>
<span class='line-number'>17</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>sirsquidness@squid ~/projects/gameservers-docker/base $ ./build.sh 
</span><span class='line'>Sending build context to Docker daemon 3.072 kB
</span><span class='line'>Step 1/5 : FROM ubuntu:16.04
</span><span class='line'> ---&gt; bd3d4369aebc
</span><span class='line'>Step 2/5 : RUN sed -i 's/archive.ubuntu.com/au.archive.ubuntu.com/' /etc/apt/sources.list
</span><span class='line'> ---&gt; Using cache
</span><span class='line'> ---&gt; a4a4d42f1211
</span><span class='line'>Step 3/5 : RUN apt-get update  && apt-get dist-upgrade -y &&  apt-get install -y unzip p7zip curl wget lib32gcc1 iproute2 vim-tiny bzip2 jq &&    apt-get clean
</span><span class='line'> ---&gt; Using cache
</span><span class='line'> ---&gt; 0325eb88ec60
</span><span class='line'>Step 4/5 : RUN echo "Australia/Melbourne" &gt; /etc/timezone
</span><span class='line'> ---&gt; Using cache
</span><span class='line'> ---&gt; deb81775de67
</span><span class='line'>Step 5/5 : RUN ln -fs /usr/share/zoneinfo/Australia/Melbourne /etc/localtime
</span><span class='line'> ---&gt; Using cache
</span><span class='line'> ---&gt; 5efc7e451ece
</span><span class='line'>Successfully built 5efc7e451ece</span></code></pre></td></tr></table></div></figure>


<p>Note that the timezone is automatically detected based on your system&rsquo;s local timezone.</p>

<p>The base image provides a set of common utilities, such as curl, jq, and common dependencies for games.</p>

<p>The next image in the chain for tf2-prophunt is <code>steamcmd</code>, which is a tool used to install Steam game servers.</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
<span class='line-number'>16</span>
<span class='line-number'>17</span>
<span class='line-number'>18</span>
<span class='line-number'>19</span>
<span class='line-number'>20</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>sirsquidness@squid ~/projects/gameservers-docker/base $ cd ../steamcmd
</span><span class='line'>sirsquidness@squid ~/projects/gameservers-docker/steamcmd $ ./build.sh 
</span><span class='line'>Sending build context to Docker daemon 3.072 kB
</span><span class='line'>Step 1/9 : FROM base
</span><span class='line'> ---&gt; 28c1c378be5d
</span><span class='line'>Step 2/9 : RUN useradd -m steam
</span><span class='line'> ---&gt; Running in a0d250c083fa
</span><span class='line'> ---&gt; 23f68f0a2e62
</span><span class='line'>[...snip....]
</span><span class='line'>[----] Verifying installation...
</span><span class='line'>Steam Console Client (c) Valve Corporation
</span><span class='line'>-- type 'quit' to exit --
</span><span class='line'>Loading Steam API...Created shared memory when not owner SteamController_Shared_mem
</span><span class='line'>OK.
</span><span class='line'>
</span><span class='line'>Connecting anonymously to Steam Public...Logged in OK
</span><span class='line'>Waiting for license info...OK
</span><span class='line'> ---&gt; b4a6b84eeb5f
</span><span class='line'>Removing intermediate container 49628529285b
</span><span class='line'>Successfully built b4a6b84eeb5f</span></code></pre></td></tr></table></div></figure>


<p>Great! <code>steamcmd</code> image is now built. If you looked carefully, you&rsquo;d have noticed that we downloaded the
steamcmd installation files automatically. This is a semi-pattern in this repository. Where it makes sense,
the build scripts will download dependencies automatically. But some other dependencies require manual
action as we will see soon.</p>

<p><code>tf2-prophunt</code> depends on the <code>tf2</code> image. Build this now. TF2 is a large server - nearly 8GB - so make sure
that you have plenty of disk space free and something to entertain you while it downloads.</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>sirsquidness@squid ~/projects/gameservers-docker/tf2 $ ./build.sh 
</span><span class='line'>Sending build context to Docker daemon 6.144 kB
</span><span class='line'>Step 1/8 : FROM steamcmd
</span><span class='line'> ---&gt; b4a6b84eeb5f
</span><span class='line'>Step 2/8 : USER steam
</span><span class='line'> ---&gt; Running in ae23e6b04ec1
</span><span class='line'> ---&gt; d810f2252646</span></code></pre></td></tr></table></div></figure>


<p>And so on. Some time later, it finishes.</p>

<p>Right now, you can run a vanilla TF2 server - what joy!</p>

<p>Documentation is still a work in progress, but you can <a href="https://github.com/OpenSourceLAN/gameservers-docker/blob/master/tf2/start-tf2.sh">check the start-tf2.sh</a>
script to see what environment variables are available. Let&rsquo;s set a
hostname and an RCON password on a vanilla TF2 server!</p>

<p><code>docker run --net=host -it --rm -e "SV_HOSTNAME=A super cool TF2 server" -e "RCON_PASSWORD=OSLisSuperCool" -e LAN=1 tf2</code></p>

<p>Boom, LAN server. But it&rsquo;s just a plain TF2 server. Time for a PropHunt server.</p>

<p><a href="https://github.com/OpenSourceLAN/gameservers-docker/blob/master/tf2-prophunt/download.sh">The tf2-prophunt download script</a>
downloads a few dependencies, such a metamod and sourcemod. However, it does not
download the PH map packs. <a href="https://github.com/powerlord/sourcemod-prophunt/releases/download/maps/PHMapEssentialsBZ2.7z">PHMapEssentialsBZ2.7z</a>
 is few hundred MB and there a few options available, so download the PH map pack that is right for you.
Place the 7z file in the tf2-prophunt directory, and run the build script</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>sirsquidness@squid ~/projects/gameservers-docker/tf2 $ cd ../tf2-prophunt/
</span><span class='line'>sirsquidness@squid ~/projects/gameservers-docker/tf2-prophunt $ wget https://github.com/powerlord/sourcemod-prophunt/releases/download/maps/PHMapEssentialsBZ2.7z
</span><span class='line'>[...snip...]
</span><span class='line'>sirsquidness@squid ~/projects/gameservers-docker/tf2-prophunt $ ./build.sh
</span><span class='line'>[...snip...]</span></code></pre></td></tr></table></div></figure>


<p>And now you have a TF2 Prophunt server installed with only a few <em>super simple commands</em>.</p>

<h3>Running a server</h3>

<p>As we&rsquo;re building docker images, you&rsquo;re free to use the docker command line
as you see fit. During the image building, there was an example of doing just that
to prove that the server worked.</p>

<p>But to make it easier, there is a simple helper script included in the root of the repository.</p>

<p>The simplest use of the script is to invoke it by itself.</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
<span class='line-number'>16</span>
<span class='line-number'>17</span>
<span class='line-number'>18</span>
<span class='line-number'>19</span>
<span class='line-number'>20</span>
<span class='line-number'>21</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>sirsquidness@squid ~/projects/gameservers-docker $ ./start_server.sh 
</span><span class='line'>Please select from one of the following images, or ctrl+c to exit:
</span><span class='line'>7daystodie
</span><span class='line'>armagetron
</span><span class='line'>base
</span><span class='line'>csgo
</span><span class='line'>csgo-comp
</span><span class='line'>csgo-ebot
</span><span class='line'>csgo-gg
</span><span class='line'>csgo-warmod
</span><span class='line'>factorio
</span><span class='line'>hl2dm
</span><span class='line'>minecraft
</span><span class='line'>openttd
</span><span class='line'>quake3
</span><span class='line'>steamcmd
</span><span class='line'>tf2
</span><span class='line'>tf2-prophunt
</span><span class='line'>trackmania
</span><span class='line'>unreal4
</span><span class='line'>Image: </span></code></pre></td></tr></table></div></figure>


<p>Type in the name of the server you want, press enter, and away it goes!</p>

<p>I typed <code>tf2-prophunt</code> and pressed enter, and this is what happened:</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>Image: tf2-prophunt
</span><span class='line'>docker run --tty --interactive --net host --restart=unless-stopped --name tf2-prophunt_1 --detach tf2-prophunt
</span><span class='line'>54da57b4c67c8e669667f43ecca88a0317c8284e91003e2d4c62ac82f0546b52</span></code></pre></td></tr></table></div></figure>




<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>sirsquidness@squid ~/projects/gameservers-docker $ docker ps
</span><span class='line'>CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES
</span><span class='line'>cd105fff9efc        tf2-prophunt        "./start-tf2-proph..."   28 seconds ago      Up 27 seconds                           tf2-prophunt_1
</span></code></pre></td></tr></table></div></figure>


<p>We can also pass the name of the server directly to the script.</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>sirsquidness@squid ~/projects/gameservers-docker $ ./start_server.sh tf2-prophunt
</span><span class='line'>docker run --tty --interactive --net host --restart=unless-stopped --name tf2-prophunt_1 --detach tf2-prophunt
</span><span class='line'>4bac06dd1a6a2437ecbdcd4d8e91c449c1360965927d7a7b5daf86053a2d072f</span></code></pre></td></tr></table></div></figure>


<p>Notice the convention for <code>--name</code> - <code>tf2-prophunt_1</code>. Every server started will get a unique number.
You can use this name to get a console to the server.</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>sirsquidness@squid ~/projects/gameservers-docker $ docker attach  tf2-prophunt_1 
</span><span class='line'>status
</span><span class='line'>hostname: TF2 Prophunt Server
</span><span class='line'>version : 3694595/24 3694595 secure</span></code></pre></td></tr></table></div></figure>


<p>Press ctrl+p, then ctrl+q to detach again. Don&rsquo;t press ctrl+c here! If you press ctrl+c,
it will send the kill signal to the game server and it will shut down.</p>

<p>Of course, that&rsquo;s not always convenient. So let&rsquo;s add an RCON password.</p>

<h3>Configuring the servers</h3>

<p>Most of the images are set up to accept environmental variables to dictate behaviour.
For example, a common one in most of the images is <code>RCON_PASSWORD</code>.</p>

<p>The <code>start_server.sh</code> script doesn&rsquo;t currently have a simple way of password long env vars
through, so let&rsquo;s use docker directly.</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>docker run --net=host -it --rm -e "SV_HOSTNAME=A super cool TF2 server" -e "RCON_PASSWORD=OSLisSuperCool" -e LAN=1 tf2</span></code></pre></td></tr></table></div></figure>


<p>Cool!</p>

<h3>Data persistence</h3>

<p>Some images support exporting important data out of the running container so that
you can delete and/or upgrade your containers without losing data. Currently only
factorio and 7daystodie support this.</p>

<p>The <code>start_server.sh</code> script will automatically detect games that support this and
create a folder of the same name as the container in the <code>data</code> folder.</p>

<p>Please double check that it is working before relying on it - file and folder
permissions are finnicky for exported mounts in docker. The easiest (and worst!)
way to make it work is making the folder globally readable and writable -
<code>chmod -R 777 data/</code>.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[A Different Way of Implementing a Steam Cache]]></title>
    <link href="http://opensourcelan.com/blog/2016/07/01/steam-cdn/"/>
    <updated>2016-07-01T12:00:00+00:00</updated>
    <id>http://opensourcelan.com/blog/2016/07/01/steam-cdn</id>
    <content type="html"><![CDATA[<p><strong>Update 2017-01-28</strong>: I released a copy of the <a href="https://github.com/OpenSourceLAN/steam-hijack">tools run your steam cache in this manner</a>. Requires a Squid proxy, and a NodeJS application running somewhere.</p>

<p>There are <a href="https://github.com/bntjah/lancache/">a</a> <a href="https://github.com/wolrah/lancache">few</a> <a href="https://github.com/multiplay/lancache/">different</a> <a href="https://github.com/ti-mo/ansible-lanparty">implementations</a> of the so called &lsquo;LAN Cache&rsquo;.
All of these rely on DNS to have the Steam client connect to the cache.</p>

<p>While a DNS override is trivial to implement, it is not the only way to get
a Steam cache working. DNS overrides also require mainteance - occasionally
the list of hostnames used for content distribution changes, and that means
Steam clients will bypass your cache if you don&rsquo;t catch that.</p>

<h3>How the Steam client discovers its CDN</h3>

<p>The Steam client is configured with a number of Content Servers (CS) which
it bootstraps from. You can see the list in
<code>%YourSteamDirectory%\config\config.vdf</code>, and look for the <code>CS</code> line.
Each of the addresses in this semicolon separated list can be used to
bootstrap.</p>

<p>The first entry in my list is <code>103.10.125.136:80</code>. Before beginning a
download, Steam will make a request to an address like this:
<code>http://103.10.125.136:80/serverlist/53/2/</code>. This returns a server list.
The first number (53) is the download region ID, <code>Australia - VIC</code> in
this example. The second number is the maximum number of servers to
return.</p>

<p>Here&rsquo;s an example response:</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
<span class='line-number'>16</span>
<span class='line-number'>17</span>
<span class='line-number'>18</span>
<span class='line-number'>19</span>
<span class='line-number'>20</span>
<span class='line-number'>21</span>
<span class='line-number'>22</span>
<span class='line-number'>23</span>
<span class='line-number'>24</span>
<span class='line-number'>25</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>
</span><span class='line'>"serverlist"
</span><span class='line'>{
</span><span class='line'>  "0"
</span><span class='line'>  {
</span><span class='line'>      "type"      "CS"
</span><span class='line'>      "sourceid"      "119"
</span><span class='line'>      "cell"      "52"
</span><span class='line'>      "load"      "72"
</span><span class='line'>      "weightedload"      "80"
</span><span class='line'>      "numentriesinclientlist"        "1"
</span><span class='line'>      "host" "10.0.0.194"
</span><span class='line'>      "vhost"     "valve5.steamcontent.com"
</span><span class='line'>  }
</span><span class='line'>  "1"
</span><span class='line'>  {
</span><span class='line'>      "type"      "CDN"
</span><span class='line'>      "vhost"     "cdn.edgecast.cs.steampowered.com"
</span><span class='line'>      "host" "10.0.0.194"
</span><span class='line'>      "load"      "0"
</span><span class='line'>      "weightedload"      "130"
</span><span class='line'>      "sourceid"      "32"
</span><span class='line'>      "numentriesinclientlist"        "2"
</span><span class='line'>  }
</span><span class='line'>}</span></code></pre></td></tr></table></div></figure>


<p>There are two entries returned, since we asked for two in the request. The
first entry is a <code>CS</code> entry, <code>valve5.steamcontent.com</code>. <code>steamcontent.com</code> is a new domain
that Valve has just started using in the last few weeks. Some of these are
owned by Valve, some are owned by ISPs. The distiction is irrelevant to us.
It is part of cell 52 which is the <code>Australia - NSW</code> region.</p>

<p>The second entry is a <code>CDN</code> entry, <code>cdn.edgecast.cs.steampowered.com</code>. EdgeCast
is a Content Distribution Network (CDN) which Valve uses to efficiently
distribute data around the globe without needing to deploy their own infrastructure.</p>

<p>Once the Steam client has a list of content servers, it makes an
<code>initsession</code> HTTP request, which is an authentication step and is not cached.
It then downloads a manfiest file
for each depot in the package. For example, if we were to download
<a href="">Swordy</a>, it has <a href="https://steamdb.info/sub/71407/depots/">one depot</a>.
All data for a depot lives in a folder beginning with <code>/depot/381301</code>,
where the number is the depot ID - Swordy&rsquo;s only one in this case.
The current manifest can be found at <code>/depot/381301/manifest/571621603566489671/5</code></p>

<p>The manifest lists all of the files for the depot. For example, one file
from the above Swordy depot is <code>/depot/381301/chunk/914fc04dc7b3330544afb6ecde72bdfad003eabb</code>.
Steam downloads and decrypts and/or decompresses, and boom - your game is downloaded.</p>

<h3>Using this knowledge to run a cache</h3>

<p>If you were paying attention, you may have noticed in the server list response
that each entry had two fields named <code>host</code> and <code>vhost</code>, and that <code>host</code> was
set to an RFC1918 address, <code>10.0.0.194</code>. This is not what Steam returned to us
 - in fact, this is how we&rsquo;ve been running our Steam cache since <a href="https://developer.valvesoftware.com/wiki/SteamPipe">SteamPipe</a>
was first implemented in late 2012.</p>

<p>All traffic leaving our LAN goes via a
transparent <a href="http://www.squid-cache.org/">Squid proxy</a> which does not itself do any
caching for Steam. Instead, we use Squid to rewrite the URL of requests that
match the regex of <code>/\/serverlist\/(\d+)\/(\d+)\/</code> and redirect them to our own
server list generator.</p>

<p>The rewriting is done using a <a href="http://www.squid-cache.org/Doc/config/url_rewrite_program/">url_rewrite_program</a>.
The URL of every request is passed to this program and the program returns
either the original URL if it&rsquo;s not a Steam serverlist request, or a URL
that points to our cache if it is a serverlist.</p>

<p>Our own server list generator will receive the request. It takes an original
genuine server list from Valve and replaces the <code>Host</code> field with the address
of our own cache, before returning that to the Steam client.
At present, it fetches the original upstream server list every
time, but it could also cache the lists as they do not change regularly.</p>

<p>Because the <code>vhost</code> field remains in tact, the Steam client will then make a
HTTP request to our cache&rsquo;s address, but it will include in the HTTP headers
a Host header, such as <code>Host: valve5.steamcontent.com</code>. This way, our cache
server can easily identify where the request was meant to be sent to, so in
a cache miss situation we can forward the request on with no issues.</p>

<h3>And there it is</h3>

<p>And that&rsquo;s how Steam downloads your games! This alternative method of caching
games has some extra complexity and overhead - it requires running a
transparent proxy and has more moving parts, but it means you do not need
to keep a list of DNS entries up to date. Isn&rsquo;t that lovely?</p>

<p>The scripts used to perform this magic haven&rsquo;t been released yet, but will be
&ldquo;soon&rdquo;. If you&rsquo;d like a copy of them in their current state, get in touch
via the links at the top of the page and we&rsquo;ll organise something.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Projects Up and Our First Major Event]]></title>
    <link href="http://opensourcelan.com/blog/2016/06/11/firstevent/"/>
    <updated>2016-06-11T12:00:00+00:00</updated>
    <id>http://opensourcelan.com/blog/2016/06/11/firstevent</id>
    <content type="html"><![CDATA[<p>After a long time going &ldquo;one day&rdquo;, I&rsquo;ve finally released some software under the Open Source LAN name. a
It&rsquo;s all on GitHub under the <a href="https://github.com/OpenSourceLAN/">OpenSourceLAN</a>
organisation.</p>

<p><a href="https://github.com/OpenSourceLAN/steam-discover"><em>steam-discover</em></a> is a
tool to report data about how many people are playing which steam games
on your LAN. Includes a simple live updating graph which you could
include on your website, and connectors to send the data to arbitrary
places like Redis, ELK, syslog or similar.</p>

<p><a href="https://github.com/OpenSourceLAN/srcds-log-receiver"><em>srcds-log-receiver</em></a>
is a simple tool that records all of the SRCDS logs sent to it. No need
to worry about copying all of the logs from your game servers - they&rsquo;re
already in one spot.</p>

<p><a href="https://github.com/OpenSourceLAN/origin-docker"><em>origin-docker</em></a> is
a terribly named repository of a single docker container which contains
Nginx set up to cache all of the major game distributions for your LAN.</p>

<p><a href="http://vectorama.info"><em>Vectorama</em></a> becomes the first LAN which I&rsquo;m
not involved with to use OpenSourceLAN software. Check out
<a href="https://www.reddit.com/r/lanparty/comments/4nb8rs/vectorama_2016_trying_out_opensourcelans/">this thread on reddit</a>
to see how they used SteamDiscover and ELK to create a super cool
dashboard of Steam activity at their event.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Placeholder]]></title>
    <link href="http://opensourcelan.com/blog/2013/10/28/placeholder/"/>
    <updated>2013-10-28T15:40:00+00:00</updated>
    <id>http://opensourcelan.com/blog/2013/10/28/placeholder</id>
    <content type="html"><![CDATA[<p>What is this place? You will find out <a href="https://developer.valvesoftware.com/wiki/Valve_Time">soon</a>.</p>

<p>Eager to see if anything has happened yet? Maybe something has appeared on the <a href="https://git.opensourcelan.com/public/projects">Gitlab page</a>. Maybe we&rsquo;ve posted something to the <a href="http://www.reddit.com/r/opensourcelan">subreddit</a>. Maybe we haven&rsquo;t published anything yet and you&rsquo;re jumping the gun.</p>
]]></content>
  </entry>
  
</feed>
