The Horror, The Horror: Building a search engine Prop for a LARP

So I was involved in Room 13’s Collector Con earlier in the year and one of the things we wanted to do as a prop was to give the players the ability to search online for clues, so what we needed was a search engine that was big enough for them to explore, but would quietly present them with fake results hidden away amongst real ones to enhance the immersion.

Being the tech-ref for the game this fun fun job fell to me to do a quick feasibility study to work out if we could do it for the game.

Now the last thing we wanted to do was have to write a search engine from scratch, and then populate it with enough fake data to hide the clues amidst false leads – that just wasn’t going to be economical in terms of how much Ref time was going to be needed to put it together.  So instead what I did was build a rewriting proxy server.  It works something like this:

A diagram of boxes showing the flow between a web-browser on the left via an apache proxy, to the DDG search engine, back through rewrite HTML, then ddg-rewriter, before returning to the web-brower

So basically a Web Browser makes a request of our server (search.example.com).  The Apache webserver makes a proxy request to http://duckduckgo.com/html (who see’s it as coming from search.example.com and not the web-browser).

Of the data that comes back, if its an HTML page then Apache rewrites http://duckduckgo.com/html to http://search.example.com/html

Every page and image is then sent to a small program called “ddg-rewriter” which scans for HTML files.  It has a list of “Keyword” -> “Fake result” associations and if it sees one of these keywords used it will insert the relevant fake result(s), if not it will leave the page unchanged.

The end result is that DDG thinks its getting search requests from search.example.com.  And the players Web Browser gets back a page that appears to be from http://search.example.com – so it has all the usual search output you would see online, but if specific keywords are used then the fake results are inserted.

Those fake results will appear to blend in better because they have a URL that is shown (so http://magicaldomain.com) however they are actually linked to somewhere else (so http://game.example.com/magicaldomain).  This means you can make it look like your search results appear from dozens of domains without having to buy a single one, as they can all be really hosted from your example.com server.

So yeah, there we go, feel free to download the code and configs and have a browse, yes its messy, yes its first drafty, yes it should be pulling in data from a database and have a nice management interface (and yes it was written by my foul mouthed alterego as usual) however it is functional and should give you some ideas for how to do this kind of thing.  There’s a README.txt in there which will include some more technical details.

If you want it: ddg-rewriter_2018-05-25.zip (11k)

Leave a Reply