Change destination in client-replay

I wrote some traffic with mitmdump and now I want to replay it to another destination. How to achieve this?

I’ve found solution with inline script:
def request(context, flow):
flow.request.host = ‘127.0.0.1’