Skip to content

Commit b27213b

Browse files
committed
Move httpStatusCodes, httpMethods and Url within top-level proxy.http package
1 parent da2a1b2 commit b27213b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+98
-58
lines changed

examples/https_connect_tunnel.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414

1515
from proxy import Proxy
1616
from proxy.common.utils import build_http_response
17-
from proxy.http.parser import httpParserStates, httpStatusCodes
17+
from proxy.http import httpStatusCodes
18+
from proxy.http.parser import httpParserStates
1819
from proxy.core.base import BaseTcpTunnelHandler
1920

2021

proxy/common/pki.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@
88
:copyright: (c) 2013-present by Abhinav Singh and contributors.
99
:license: BSD, see LICENSE for more details.
1010
"""
11-
import time
11+
import os
1212
import sys
13+
import uuid
14+
import time
15+
import logging
16+
import tempfile
1317
import argparse
1418
import contextlib
15-
import os
16-
import uuid
1719
import subprocess
18-
import tempfile
19-
import logging
20+
2021
from typing import List, Generator, Optional, Tuple
2122

2223
from .utils import bytes_

proxy/core/connection/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
:copyright: (c) 2013-present by Abhinav Singh and contributors.
99
:license: BSD, see LICENSE for more details.
1010
"""
11-
import socket
1211
import ssl
12+
import socket
13+
1314
from typing import Union, Tuple, Optional
1415

1516
from .connection import TcpConnection, TcpConnectionUninitializedException

proxy/core/connection/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
:copyright: (c) 2013-present by Abhinav Singh and contributors.
99
:license: BSD, see LICENSE for more details.
1010
"""
11-
import socket
1211
import ssl
12+
import socket
1313
import logging
1414

1515
from abc import ABC, abstractmethod

proxy/core/connection/pool.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from typing import Set, Dict, Tuple
1414

1515
from ...common.flag import flags
16+
1617
from .server import TcpServerConnection
1718

1819
logger = logging.getLogger(__name__)

proxy/core/connection/types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@
1717
('CLIENT', int),
1818
],
1919
)
20+
2021
tcpConnectionTypes = TcpConnectionTypes(1, 2)

proxy/dashboard/dashboard.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616
from .plugin import ProxyDashboardWebsocketPlugin
1717

1818
from ..common.utils import build_http_response, bytes_
19-
from ..http.server import HttpWebServerPlugin, HttpWebServerBasePlugin, httpProtocolTypes
20-
from ..http.parser import HttpParser, httpStatusCodes
19+
20+
from ..http import httpStatusCodes
21+
from ..http.parser import HttpParser
2122
from ..http.websocket import WebsocketFrame
23+
from ..http.server import HttpWebServerPlugin, HttpWebServerBasePlugin, httpProtocolTypes
2224

2325
logger = logging.getLogger(__name__)
2426

proxy/http/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,14 @@
1010
"""
1111
from .handler import HttpProtocolHandler
1212
from .plugin import HttpProtocolHandlerPlugin
13+
from .codes import httpStatusCodes
14+
from .methods import httpMethods
15+
from .url import Url
1316

1417
__all__ = [
1518
'HttpProtocolHandler',
1619
'HttpProtocolHandlerPlugin',
20+
'httpStatusCodes',
21+
'httpMethods',
22+
'Url',
1723
]
File renamed without changes.

proxy/http/exception/proxy_auth_failed.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
:license: BSD, see LICENSE for more details.
1010
"""
1111
from .base import HttpProtocolException
12-
from ..parser import HttpParser, httpStatusCodes
12+
13+
from ..codes import httpStatusCodes
14+
from ..parser import HttpParser
1315

1416
from ...common.constants import PROXY_AGENT_HEADER_VALUE, PROXY_AGENT_HEADER_KEY
1517
from ...common.utils import build_http_response

0 commit comments

Comments
 (0)