GithubHelp home page GithubHelp logo

se7enth / vmess2json Goto Github PK

View Code? Open in Web Editor NEW

This project forked from boypt/vmess2json

0.0 0.0 0.0 81 KB

Simple script parses vmess:// links into client v2ray config json.

License: MIT License

Python 100.00%

vmess2json's Introduction

Vmess2Json

Simple script parses vmess:// links into client v2ray config json. (ss:// links also supported) Currently only V2rayN/NG format is supported.

Usage

usage: vmess2json.py [-h] [--parse_all] [--subscribe SUBSCRIBE] [-o OUTPUT]
                     [-u UPDATE] [--outbound] [--inbounds INBOUNDS]
                     [--secret SECRET]
                     [vmess]

vmess2json convert vmess link to client json config.

positional arguments:
  vmess                 A vmess:// link. If absent, reads a line from stdin.

optional arguments:
  -h, --help            show this help message and exit
  --parse_all           parse all vmess:// lines (or base64 encoded) from
                        stdin and write each into .json files
  --subscribe SUBSCRIBE
                        read from a subscribe url, display a menu to choose
                        nodes
  -o OUTPUT, --output OUTPUT
                        write to file. default to stdout
  -u UPDATE, --update UPDATE
                        update a config.json, changes only the first outbound
                        object.
  --outbound            output the outbound object only.
  --inbounds INBOUNDS   include inbounds objects, default:
                        "socks:1080,http:8123". Available proto:
                        socks,http,dns,mt,tproxy . For mtproto with custom
                        password: mt:7788:xxxxxxxxxxxxxxx
  --localdns LOCALDNS   use domestic DNS server for geosite:cn list domains.

Example

Most common usage is to choose node from a subscribe source.

$ wget https://vmess.subscribe.domian/sub.txt
$ cat sub.txt | sudo vmess2json.py --inbounds http:8123,socks:7070 --output /etc/v2ray/config.json
Found 5 items.
[1] - [hk1] hk1.domain.co:8388/shadowsocks
[2] - [ca/kcp4] ca.domain.ml:17738/kcp
[3] - [ca/kcp6] ca6.domain.ml:17738/kcp
[4] - [ca/cf] caf.domain.ml:443/ws
[5] - [lit/ws] lit6.domain.ml:443/ws

Choose >>> 5
$ sudo systemctl restart v2ray

Or just update the outbound object for a well written config.json.

$ cat sub.txt | sudo vmess2json.py --update /etc/v2ray/config.json
$ sudo systemctl restart v2ray

And many more other usages...

# manualy check on a link (checkout outbound info)
vmess2json.py --outbound vmess://ABCDEFGabcdefg1234567890...
echo "vmess://ABCDEFGabcdefg1234567890..." | vmess2json.py --outbound

# convert a vmess link into a config.json with some inbounds.
vmess2json.py --inbounds http:8123,socks:7070,mt:8888 -o /etc/v2ray/config.json vmess://ABCDEFGabcdefg123456...

# wirte multiple .json (per line)
cat vmess_list.txt | vmess2json.py --parse_all

# choose from an online subscribe source
vmess2json.py --subscribe https://vmess.subscribe.domian/sub.txt -o /etc/v2ray/config.json

vmess2json's People

Contributors

boypt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.