# Deploys a socket filter eBPF program that looks for http requests, records
# them, tracks the corresponding responses generated by the server and outputs
# number of exchanges, sources and latencies

# Test with multiple interleaving exchanges and long fragmented responses

from bottle import route, run, template
from sys import argv

@route('/')
def index():
    # 100 bytes of lorem ipsum
    return '''Lorem ipsum dolor sit amet, consectetur adipiscing elit.
     Mauris ut quam nec dolor sagittis volutpat.'''

host = 'localhost'

if len(argv) == 3:
  if str(argv[1]) == '-h':
    host = argv[2]

run(host=host, port=8080)
