Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Sloppy protocol StoreID rules for Steam CDN
# This creates an access control list to match Steam's CDN
acl steamcdn dstdomain .cs.steampowered.com
# Specify what program to pipe URL through
store_id_program /usr/local/bin/steamrewrite
# How many of them to spawn at once. No documentation on this
store_id_children 10 startup=3 idle=1 concurrency=0
# Specify the ACL for URLs to be mangled
store_id_access allow steamcdn
store_id_access deny all
#!/bin/bash
# Kenneth Finnegan
# Remaps any http://valve###.cs.steampowered.com/... URL
# to http://valveX.cs.steampowered.com/...
#
# DON't USE THIS! Bash is a terrible language to do this in.
# Spawning two new processes per HTTP request is utterly stupid.
# TODO: Reimplement in Python
#
# It also doesn't do any error checking for non-chunk URLs and return the
# appropriate "ERR" instead of "OK store-id=..."
while read LINE; do
echo $LINE |
sed 's|http://valve[0-9]*\.cs\.steampowered\.com|OK store-id=http://valveX\.cs\.steampowered\.com|'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment