直接上代码,这不是去幼儿园的车,不懂的人还是单纯点好!

#!/usr/bin/env python2.7
# _*_ coding: utf-8 _*_
#  By:www.52our.com

import sys
import base64
import os

keys = sys.argv[1]

if keys[:5] == 'ss://':

    key = base64.b64decode(keys[5:]+'==')
    print "\n****************\nLoading SS account information...\n**************\n"

    method =  key.split(':')[0]
    port =  key.split(':')[-1]
    ip = key.split('@')[-1].rstrip(':'+port)
    pwd = key.split('@'+ip+':'+port)[0].lstrip(method+':')
    print ip,port,pwd,method+'\n'
    print "Enable proxy:\n"
    os.system('sslocal'+' -s '+ip+' -p '+port+' -k '+pwd+' -m '+method)

else: 

    key = base64.b64decode(keys[6:]+'==').split('/')[0]
    print "\n****************\nLoading SSR account information...\n**************\n"

    ssr = key.split(':')
    ssr[5] = base64.b64decode(ssr[5]+'==')
    print ssr
    print "Enable proxy:\n"
    os.system('python2.7 /home/hzl/ssr/shadowsocksr/shadowsocks/local.py -v'+' -s '+ssr[0]+' -p '+ssr[1]+' -k '+ssr[5]+' -m '+ssr[3]+' -o '+ssr[2])

我的机器本来装有ss,所以直接用sslocal命令,ssr用的是文件路径下的。

运行结果:
ss

ssr