Skip to content

Instantly share code, notes, and snippets.

@PhirePhly
Created August 1, 2014 07:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PhirePhly/76345fa72ecdb6fb1d37 to your computer and use it in GitHub Desktop.
Save PhirePhly/76345fa72ecdb6fb1d37 to your computer and use it in GitHub Desktop.
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