Is that demo of yours available somewhere? It sounds interesting and I'd love to read up on it
I think this is the code: https://github.com/paulgb/cachebeacon
It basically just runs two servers:
- A DNS server that resolved a list of domains to its own IP.
- An HTTP server that looked at the HTTP host and proxied requests to the upstream server. If the content type or extension indicated that the response was JavaScript, it would add the payload and set cache headers to cache as long as possible.
- A special HTTP endpoint on the proxy server to capture data sent back from the payload.