diff --git a/libmproxy/flow.py b/libmproxy/flow.py index 42fc36cc0..1870761f4 100644 --- a/libmproxy/flow.py +++ b/libmproxy/flow.py @@ -8,12 +8,13 @@ import Cookie import cookielib import os import re -from netlib import odict, wsgi +from netlib import odict, wsgi, tcp import netlib.http from . import controller, protocol, tnetstring, filt, script, version from .onboarding import app from .protocol import http, handle from .proxy.config import HostMatcher +from .proxy.connection import ClientConnection, ServerConnection import urlparse ODict = odict.ODict @@ -768,9 +769,19 @@ class FlowMaster(controller.Master): Creates a new request from params and add it to flow list. created request is empty (except for method and url) but is able to be replayed - """ - f = http.HTTPFlow(None,None); + c = ClientConnection.from_state(dict( + address=dict(address=(host, port), use_ipv6=False), + clientcert=None + )) + + s = ServerConnection.from_state(dict( + address=dict(address=(host, port), use_ipv6=False), + state=[], + source_address=None, #source_address=dict(address=(host, port), use_ipv6=False), + cert=None + )) + f = http.HTTPFlow(c,s); headers = ODictCaseless() req = http.HTTPRequest("absolute", method, scheme, host, port, path, (1, 1), headers, None,