mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
added ClientConnection and ServerConnection to new request
This commit is contained in:
parent
58091b7041
commit
fbba6bfe06
@ -8,12 +8,13 @@ import Cookie
|
|||||||
import cookielib
|
import cookielib
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
from netlib import odict, wsgi
|
from netlib import odict, wsgi, tcp
|
||||||
import netlib.http
|
import netlib.http
|
||||||
from . import controller, protocol, tnetstring, filt, script, version
|
from . import controller, protocol, tnetstring, filt, script, version
|
||||||
from .onboarding import app
|
from .onboarding import app
|
||||||
from .protocol import http, handle
|
from .protocol import http, handle
|
||||||
from .proxy.config import HostMatcher
|
from .proxy.config import HostMatcher
|
||||||
|
from .proxy.connection import ClientConnection, ServerConnection
|
||||||
import urlparse
|
import urlparse
|
||||||
|
|
||||||
ODict = odict.ODict
|
ODict = odict.ODict
|
||||||
@ -768,9 +769,19 @@ class FlowMaster(controller.Master):
|
|||||||
Creates a new request from params and add it to flow list.
|
Creates a new request from params and add it to flow list.
|
||||||
created request is empty (except for method and url) but is able
|
created request is empty (except for method and url) but is able
|
||||||
to be replayed
|
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()
|
headers = ODictCaseless()
|
||||||
|
|
||||||
req = http.HTTPRequest("absolute", method, scheme, host, port, path, (1, 1), headers, None,
|
req = http.HTTPRequest("absolute", method, scheme, host, port, path, (1, 1), headers, None,
|
||||||
|
Loading…
Reference in New Issue
Block a user