Browse Source

check cipher before daemon start

fix #280
master
clowwindy 10 years ago
parent
commit
7aa37cad8e
  1. 13
      README.md
  2. 5
      shadowsocks/local.py
  3. 4
      shadowsocks/server.py
  4. 3
      shadowsocks/utils.py

13
README.md

@ -28,12 +28,19 @@ See [Install Server on Windows]
### Usage ### Usage
ssserver -p 8000 -k password -m rc4-md5 ssserver -p 443 -k password -m rc4-md5
To run in the background: To run in the background:
ssserver -p 8000 -k password -m rc4-md5 -d start sudo ssserver -p 443 -k password -m rc4-md5 --user nobody -d start
ssserver -p 8000 -k password -m rc4-md5 -d stop
To stop:
sudo ssserver -d stop
To check the log:
sudo less /var/log/shadowsocks.log
Check all the options via `-h`. You can also use a [Configuration] file Check all the options via `-h`. You can also use a [Configuration] file
instead. instead.

5
shadowsocks/local.py

@ -30,8 +30,7 @@ import logging
import signal import signal
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../')) sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../'))
from shadowsocks import utils, daemon, encrypt, eventloop, tcprelay, udprelay,\ from shadowsocks import utils, daemon, eventloop, tcprelay, udprelay, asyncdns
asyncdns
def main(): def main():
@ -49,8 +48,6 @@ def main():
utils.print_shadowsocks() utils.print_shadowsocks()
encrypt.try_cipher(config['password'], config['method'])
try: try:
logging.info("starting local at %s:%d" % logging.info("starting local at %s:%d" %
(config['local_address'], config['local_port'])) (config['local_address'], config['local_port']))

4
shadowsocks/server.py

@ -30,8 +30,7 @@ import logging
import signal import signal
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../')) sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../'))
from shadowsocks import utils, daemon, encrypt, eventloop, tcprelay, udprelay,\ from shadowsocks import utils, daemon, eventloop, tcprelay, udprelay, asyncdns
asyncdns
def main(): def main():
@ -57,7 +56,6 @@ def main():
else: else:
config['port_password'][str(server_port)] = config['password'] config['port_password'][str(server_port)] = config['password']
encrypt.try_cipher(config['password'], config['method'])
tcp_servers = [] tcp_servers = []
udp_servers = [] udp_servers = []
dns_resolver = asyncdns.DNSResolver() dns_resolver = asyncdns.DNSResolver()

3
shadowsocks/utils.py

@ -30,6 +30,7 @@ import sys
import getopt import getopt
import logging import logging
from shadowsocks.common import to_bytes, to_str, IPNetwork from shadowsocks.common import to_bytes, to_str, IPNetwork
from shadowsocks import encrypt
VERBOSE_LEVEL = 5 VERBOSE_LEVEL = 5
@ -95,6 +96,8 @@ def check_config(config):
logging.error('user can be used only on Unix') logging.error('user can be used only on Unix')
sys.exit(1) sys.exit(1)
encrypt.try_cipher(config['password'], config['method'])
def get_config(is_local): def get_config(is_local):
logging.basicConfig(level=logging.INFO, logging.basicConfig(level=logging.INFO,

Loading…
Cancel
Save