added ClientConnection and ServerConnection to new request

This commit is contained in:
Marcelo Glezer 2015-02-12 01:42:48 -03:00
parent 58091b7041
commit fbba6bfe06

View File

@ -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,