-
Notifications
You must be signed in to change notification settings - Fork 8.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FOV001 - Endpoint Specification #1569
Comments
请教,匹配endpoint的正则怎么写?注意server-address可能是ipv6。 p.s.为什么要正侧: |
可加一个提醒,如果是IPv6地址,应强制使用 避免与混淆导致解析困难。 |
We should build a standardized parser for this. If no one is on this task, I can have this done. |
|
Can anyone recomend any subscription server implemetation? |
This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days |
This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days |
MIME provides see https://www.iana.org/assignments/media-types/text/uri-list |
Future of V (001): Endpoint Specification
Based on other requests (#1487), here is a proposal for V2Ray endpoint specification.
Endpoint
V2Ray endpoint is the entry point of a V2Ray service. It is usually provided by V2Ray service providers, and consumed by their users.
One endpoint should contain the following information:
The endpoint can be serialized into two form: protocol oriented form, and service oriented form. The protocol oriented form is supposed to be used for one time exchange of an endpoint information. The service oriented form is supposed to be used for multiple endpoints together, and also regular updates afterwards.
Protocol Oriented Serialization
This form of serialization provides a single endpoint with specific proxy protocol.
<proxy-protocol> :// <user-info> @ <server-address> : <server-port> <path-info> ? <parameters> # <comment>
proxy-protocol
: Name of the proxy protocol. Suggested names:ss
for Shadowsocks,vmess1
for VMess. The namevmess
is not used on purpose, to not conflict with existing serializations.user-info
: User infomation for connecting to the proxy. This information depends on spcified proxy being used. Suggestions:user-info = websafe-base64-encode-utf8(method ":" password)
user-info = uuid
, such as123e4567-e89b-12d3-a456-426655440000
server-address
: IP or domain address of the server.server-port
: Either a TCP port or UDP port number.path-info
: A valid HTTP path. It must begin with '/'.parameters
: List of additional parameters to describe the endpoint. The parameters are separated by '&'. Each parameter must be a valid HTTP query. See below for more details.comment
: Additional information regarding this serialization. It is not part of the actual endpoint.Parameters
Below is a list of suggested parameters. All parameters are optional. If they are absent in the final URL, the default value shall be used.
For simplicity, all parameter names are lower-cased.
tag = <string>
: Tag of the endpoint, when being used as an outbound in V2Ray. Default value is empty string.tls = true | false
: Whether or not to enable TLS. Default value isfalse
.network = tcp | mkcp | ws | http | quic
: The network of the transport protocol. Default value istcp
.network
isws
orhttp
, thepath-info
is used as part of the protocol.kcp.uplinkcapacity = <number>
: Mapped touplinkCapacity
in mKCP configuration.kcp.downlinkcapacity = <number>
: Mapped todownlinkCapacity
in mKCP configuration.header = none | http | srtp | utp | wechat-video | dtls | wireguard
: Obfuscation header for transport protocol. Default value isnone
.http
is effective only whennetwork
istcp
.srtp
,utp
,wechat-video
,dtls
,wireguard
are effective whennetwork
ismkcp
orquic
.mux = <number>
: Concurrency of Mux. When the value is0
, Mux is disabled. Default value is0
.Service Oriented Serialization
This form of serialization is transfering a list of endpoints and their routing rules.
v2ray://<provider-name> <path-info> ? <parameters> # <comment>
provider-name
: Domain name from the service provider.path-info
: A valid HTTP path. It must begin with '/'.parameters
: List of additional parameters to describe the service. The parameters are separated by '&'. Each parameter must be a valid HTTP query. See below for more details.comment
: Additional information regarding this serialization. It is not part of the actual endpoint.Parameters
Below is a list of suggested parameters. All parameters are optional. If they are absent in the final URL, the default value shall be used.
For simplicity, all parameter names are lower-cased.
encoding = base64
: Encoding ofoutbound
andrule
parameter values. Default value isbase64
.outbound = <string>
: Mapped to one OutboundObject. Whenoutbound
appears multiple times in one serialization, eachoutbound
represents a separate OutboundObject. This parameter must exist at least once, whensubscription
isoff
.rule = <string>
: Mapped to one RuleObject. Default value is empty string.subscription = off | on
: Default value isoff
.Subscription
When
subscription
ison
, the service provider must offer a HTTPS resource for updates of the V2Ray endpoint. The URL of HTTPS resource is converted from the service oriented serialization, by simply changingv2ray
tohttps
. For example, given the V2Ray endpoint:v2ray://example-service.com/get-updates/?subscription=on
Users can assume the HTTPS resource available as:
https://example-service.com/get-updates/
This HTTPS resource outputs updated list of V2Ray endpoints in various of formats.
Simple List
The HTTPS resource must respond with HTTP header
Content-Type: text/plain
. The body of HTTP response is a list of V2Ray endpoints, separated by new line charaters (\r\n
).The text was updated successfully, but these errors were encountered: