In that case, you'll be writing a proxy server. When a client connects to the proxy for the first time, you record the current time. Every time the client makes another request, you check the current time against the one that was recorded on first connection. Greater than 30 seconds? Don't forward the request to the destination server.