V2Ray core doesn't provide subscription feature, this is cool because it's considered unnecessery to people who self-host just one or several V2Ray services. If using service bought from websites, however, one may have to find a client with subscribe support to get a better user experience.
Up to now, there are several subscription formats; I'm gonna explore to resolve some of them on my own demand, using Python or even other languages.
- Subscription url: a regular url (http / https);
- Return content of subscription url: a list of share link, separated by newline, at last encoded using
- Support schemes:
HOWTO Fetch Internet Resources Using The urllib Package — Python 3.8.0 documentation
from urllib.request import urlopen
Now we should get a really long string that seems random, like this:
base64 — Base16, Base32, Base64, Base85 Data Encodings — Python 3.8.0 documentation
from base64 import b64decode
This step we get a list of share link string:
urllib.parse — Parse URLs into components — Python 3.8.0 documentation
json — JSON encoder and decoder — Python 3.8.0 documentation
from urllib.parse import urlsplit
Finally we get a list of json objects, each of them contains a server configuraion: