-
Notifications
You must be signed in to change notification settings - Fork 125
vmesseditor
Preston edited this page Oct 26, 2019
·
2 revisions
vmesseditor.py
parses subscribtion files and allow user to edit one of the configs.
Editor accepets both base64 encoded or plain text subscribtion, but outputs only plain texts.
Edit a subscription file subs.txt
./vmesseditor.py subs.txt
==============================================================
[ 0 ] - [node/cf] node.domain.ml:443/ws
[ 1 ] - [node/kcp4] node.domain.ml:12738/kcp
[ 2 ] - [node/kcp6] node6.domain.ml:12738/kcp
[ 3 ] - [node/kcp4] node.domain.ml:1933/kcp
==============================================================
Commands need index as the arg (example: `edit 3')
del, edit, dup
Commands needs no args:
add, sort, sortdesc, save, quit, help
CMD >>>
help
command will show text about them
* del - Delete an item, example: del 12
* edit - Edit an item in an external editor (defaultly vi, via $EDITOR env variable) will be run for the json format.
* dup - Duplicate an item, with the 'ps' appended a suffix .dup
* add - Input a new vmess item in to the subscribtion.
* sort - Sort the items by the 'ps'.
* sortdesc - Sort the items by the 'ps' in descedent order. (reversed order)
* save - Save and quit.
* quit - Quit without saveing (same as pressing Ctrl+C).
Now you can enter command edit X
to edit the X
config, the script calls vim
to open a template file with config content.
{
"v": "2",
"ps": "node/cf",
"add": "node.domain.net",
"port": "443",
"id": "2aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
"aid": "8",
"net": "ws",
"type": "none",
"host": "",
"path": "/abc123",
"tls": "tls"
}
On save and exit :wq
, scripts parses the context and return to the main menu.
Use command save
to save and exit, now you have an updated subscribtion file.
OR:
Edit a single vmess://
link
./vmesseditor.py vmess://abcdEFGHIJK....