Browse Source

xray-core: add example configs

Thry're from v2fly/v2ray-core wikis, used as examples.

Signed-off-by: Tianling Shen <cnsztl@project-openwrt.eu.org>
lilik-openwrt-22.03
Tianling Shen 4 years ago
parent
commit
c8c2564012
No known key found for this signature in database GPG Key ID: 6850B6345C862176
3 changed files with 78 additions and 0 deletions
  1. +21
    -0
      net/xray-core/Makefile
  2. +25
    -0
      net/xray-core/files/vpoint_socks_vmess.json
  3. +32
    -0
      net/xray-core/files/vpoint_vmess_freedom.json

+ 21
- 0
net/xray-core/Makefile View File

@ -40,10 +40,18 @@ define Package/xray-core
PROVIDES:=v2ray-core
endef
define Package/xray-example
$(call Package/xray/template)
TITLE+= (example configs)
DEPENDS:=xray-core
PKGARCH:=all
endef
define Package/xray-geodata
$(call Package/xray/template)
TITLE+= (geodata files)
DEPENDS:=xray-core
PKGARCH:=all
endef
define Package/xray/description
@ -55,6 +63,12 @@ define Package/xray-core/description
$(call Package/xray/description)
endef
define Package/xray-example/description
$(call Package/xray/description)
This includes example configuration files for xray-core.
endef
define Package/xray-geodata/description
$(call Package/xray/description)
@ -97,6 +111,12 @@ define Package/xray-core/install
$(LN) xray $(1)/usr/bin/v2ray
endef
define Package/xray-example/install
$(INSTALL_DIR) $(1)/etc/xray/
$(INSTALL_CONF) $(CURDIR)/files/vpoint_socks_vmess.json $(1)/etc/xray/
$(INSTALL_CONF) $(CURDIR)/files/vpoint_vmess_freedom.json $(1)/etc/xray/
endef
define Package/xray-geodata/install
$(INSTALL_DIR) $(1)/usr/share/xray/
$(INSTALL_DATA) $(DL_DIR)/$(GEOIP_FILE) $(1)/usr/share/xray/geoip.dat
@ -104,4 +124,5 @@ define Package/xray-geodata/install
endef
$(eval $(call BuildPackage,xray-core))
$(eval $(call BuildPackage,xray-example))
$(eval $(call BuildPackage,xray-geodata))

+ 25
- 0
net/xray-core/files/vpoint_socks_vmess.json View File

@ -0,0 +1,25 @@
{
"log": {
"loglevel": "warning"
},
"inbounds": [{
"port": 1080,
"listen": "127.0.0.1",
"protocol": "socks",
"settings": {
"auth": "noauth",
"udp": false,
"ip": "127.0.0.1"
}
}],
"outbounds": [{
"protocol": "freedom",
"settings": {},
"tag": "direct"
}],
"policy": {
"levels": {
"0": {"uplinkOnly": 0}
}
}
}

+ 32
- 0
net/xray-core/files/vpoint_vmess_freedom.json View File

@ -0,0 +1,32 @@
{
"inbounds": [{
"port": 10086,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "23ad6b10-8d1a-40f7-8ad0-e3e35cd38297",
"level": 1,
"alterId": 64
}
]
}
}],
"outbounds": [{
"protocol": "freedom",
"settings": {}
},{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
}],
"routing": {
"rules": [
{
"type": "field",
"ip": ["geoip:private"],
"outboundTag": "blocked"
}
]
}
}

Loading…
Cancel
Save