split up proxy.py

This commit is contained in:
Maximilian Hils
2014-03-09 21:13:08 +01:00
parent 2e50b10735
commit fc4fe83eaf
13 changed files with 207 additions and 188 deletions

View File

@@ -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):

View File

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

View File

@@ -1,5 +1,5 @@
from .. import stateobject, utils, version
from ..proxy import ServerConnection, ClientConnection
from ..prxy.connection import ClientConnection, ServerConnection
import copy