mirror of
https://github.com/zhigang1992/mitmproxy.git
synced 2026-04-23 20:00:09 +08:00
split up proxy.py
This commit is contained in:
@@ -1,14 +1,7 @@
|
||||
from ..proxy import ServerConnection, AddressPriority
|
||||
from ..prxy.server import AddressPriority
|
||||
|
||||
KILL = 0 # const for killed requests
|
||||
|
||||
class ConnectionTypeChange(Exception):
|
||||
"""
|
||||
Gets raised if the connetion type has been changed (e.g. after HTTP/1.1 101 Switching Protocols).
|
||||
It's up to the raising ProtocolHandler to specify the new conntype before raising the exception.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class ProtocolHandler(object):
|
||||
def __init__(self, c):
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import Cookie, urllib, urlparse, time, copy
|
||||
from email.utils import parsedate_tz, formatdate, mktime_tz
|
||||
from ..prxy.connection import ServerConnection
|
||||
from ..prxy.exception import ProxyError, ConnectionTypeChange
|
||||
from ..prxy.server import AddressPriority
|
||||
import netlib.utils
|
||||
from netlib import http, tcp, http_status, odict
|
||||
from netlib import http, tcp, http_status
|
||||
from netlib.odict import ODict, ODictCaseless
|
||||
from . import ProtocolHandler, ConnectionTypeChange, KILL, TemporaryServerChangeMixin
|
||||
from .. import encoding, utils, version, filt, controller, stateobject
|
||||
from ..proxy import ProxyError, AddressPriority, ServerConnection
|
||||
from . import ProtocolHandler, KILL, TemporaryServerChangeMixin
|
||||
from .. import encoding, utils, filt, controller, stateobject
|
||||
from .primitives import Flow, Error
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from .. import stateobject, utils, version
|
||||
from ..proxy import ServerConnection, ClientConnection
|
||||
from ..prxy.connection import ClientConnection, ServerConnection
|
||||
import copy
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user