Browse Source

Revert commit fd9214b334

dev
noisyfox 8 years ago
parent
commit
f0b0a31baf
  1. 12
      mujson_mgr.py

12
mujson_mgr.py

@ -65,11 +65,8 @@ class MuMgr(object):
obfs = user.get('obfs', '') obfs = user.get('obfs', '')
protocol = protocol.replace("_compatible", "") protocol = protocol.replace("_compatible", "")
obfs = obfs.replace("_compatible", "") obfs = obfs.replace("_compatible", "")
link = "%s:%s:%s:%s:%s:%s" % (self.server_addr, user['port'], protocol, user['method'], obfs, link = "%s:%s:%s:%s:%s:%s" % (self.server_addr, user['port'], protocol, user['method'], obfs, common.to_str(base64.urlsafe_b64encode(common.to_bytes(user['passwd']))).replace("=", ""))
common.to_str(base64.urlsafe_b64encode(common.to_bytes(user['passwd']))).replace( return "ssr://" + (encode and common.to_str(base64.urlsafe_b64encode(common.to_bytes(link))).replace("=", "") or link)
"=", ""))
return "ssr://" + (
encode and common.to_str(base64.urlsafe_b64encode(common.to_bytes(link))).replace("=", "") or link)
def userinfo(self, user): def userinfo(self, user):
ret = "" ret = ""
@ -97,9 +94,7 @@ class MuMgr(object):
return ret return ret
def rand_pass(self): def rand_pass(self):
return ''.join( return ''.join([random.choice('''ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~-_=+(){}[]^&%$@''') for i in range(8)])
[random.choice('''ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~-_=+(){}[]^&%$@''') for i
in range(8)])
def add(self, user): def add(self, user):
up = {'enable': 1, 'u': 0, 'd': 0, 'method': "aes-128-cfb", up = {'enable': 1, 'u': 0, 'd': 0, 'method': "aes-128-cfb",
@ -324,6 +319,5 @@ def main():
elif action is None: elif action is None:
print_server_help() print_server_help()
if __name__ == '__main__': if __name__ == '__main__':
main() main()

Loading…
Cancel
Save