import json
with open('/usr/local/etc/xray/config.json') as f:
    cfg = json.load(f)
for i in cfg['inbounds']:
    if i['port'] == 8443 and i['streamSettings']['network'] == 'ws':
        i['streamSettings']['wsSettings']['path'] = '/vless'
with open('/usr/local/etc/xray/config.json','w') as f:
    json.dump(cfg, f, indent=2)
print('config updated')
