#!/usr/bin/env python3
"""Serve the POC files on localhost:8080.

Chrome is launched with --host-resolver-rules so that a.test and b.test both
resolve to 127.0.0.1; the different eTLD+1 forces site isolation, giving the
A -> B -> A frame topology with B as an OOPIF and inner-A as a local root in
A's renderer process.
"""
import http.server
import socketserver
import os

os.chdir(os.path.dirname(os.path.abspath(__file__)))

class Handler(http.server.SimpleHTTPRequestHandler):
    def end_headers(self):
        self.send_header('Cache-Control', 'no-store')
        super().end_headers()

socketserver.TCPServer.allow_reuse_address = True
with socketserver.TCPServer(('127.0.0.1', 8080), Handler) as httpd:
    print('Serving on http://127.0.0.1:8080/')
    httpd.serve_forever()
