Browse Source

use absolute import

auth
clowwindy 10 years ago
parent
commit
0814888ba5
  1. 7
      shadowsocks/asyncdns.py
  2. 14
      shadowsocks/encrypt.py
  3. 8
      shadowsocks/local.py
  4. 8
      shadowsocks/server.py
  5. 7
      shadowsocks/tcprelay.py
  6. 7
      shadowsocks/udprelay.py

7
shadowsocks/asyncdns.py

@ -27,14 +27,13 @@ import socket
import struct
import re
import logging
import common
import lru_cache
import eventloop
from shadowsocks import common, lru_cache, eventloop
CACHE_SWEEP_INTERVAL = 30
VALID_HOSTNAME = re.compile("(?!-)[A-Z\d-]{1,63}(?<!-)$", re.IGNORECASE)
VALID_HOSTNAME = re.compile(r"(?!-)[A-Z\d-]{1,63}(?<!-)$", re.IGNORECASE)
common.patch_socket()

14
shadowsocks/encrypt.py

@ -26,19 +26,17 @@ import hashlib
import string
import struct
import logging
import crypto.m2
import crypto.rc4_md5
import crypto.salsa20_ctr
import crypto.ctypes_openssl
from shadowsocks.crypto import m2, rc4_md5, salsa20_ctr, ctypes_openssl
method_supported = {}
method_supported.update(crypto.rc4_md5.ciphers)
method_supported.update(crypto.salsa20_ctr.ciphers)
method_supported.update(crypto.ctypes_openssl.ciphers)
method_supported.update(rc4_md5.ciphers)
method_supported.update(salsa20_ctr.ciphers)
method_supported.update(ctypes_openssl.ciphers)
# let M2Crypto override ctypes_openssl
method_supported.update(crypto.m2.ciphers)
method_supported.update(m2.ciphers)
def random_string(length):

8
shadowsocks/local.py

@ -25,12 +25,8 @@ import sys
import os
import logging
import signal
import utils
import encrypt
import eventloop
import tcprelay
import udprelay
import asyncdns
from shadowsocks import utils, encrypt, eventloop, tcprelay, udprelay, asyncdns
def main():

8
shadowsocks/server.py

@ -25,12 +25,8 @@ import sys
import os
import logging
import signal
import utils
import encrypt
import eventloop
import tcprelay
import udprelay
import asyncdns
from shadowsocks import utils, encrypt, eventloop, tcprelay, udprelay, asyncdns
def main():

7
shadowsocks/tcprelay.py

@ -28,10 +28,9 @@ import struct
import logging
import traceback
import random
import encrypt
import eventloop
import utils
from common import parse_header
from shadowsocks import encrypt, eventloop, utils
from shadowsocks.common import parse_header
TIMEOUTS_CLEAN_SIZE = 512

7
shadowsocks/udprelay.py

@ -72,10 +72,9 @@ import logging
import struct
import errno
import random
import encrypt
import eventloop
import lru_cache
from common import parse_header, pack_addr
from shadowsocks import encrypt, eventloop, lru_cache
from shadowsocks.common import parse_header, pack_addr
BUF_SIZE = 65536

Loading…
Cancel
Save