Skip to content

Commit

Permalink
fix: remove redundant data in v2ray default.json
Browse files Browse the repository at this point in the history
also, insert outbound to json's outbounds instead of appending
  • Loading branch information
SaintShit committed Feb 28, 2024
1 parent 1a9dcd1 commit d3137a1
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 82 deletions.
4 changes: 2 additions & 2 deletions app/subscription/v2ray.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ def __init__(self):
def add_outbound(self, remarks, outbound_data, proxy_outbound):
json_template = json.loads(self.template)
json_template["remarks"] = remarks
json_template["outbounds"].append(outbound_data)
json_template["outbounds"].insert(0, (outbound_data))
if proxy_outbound:
json_template["outbounds"].append(proxy_outbound)
json_template["outbounds"].insert(0, (proxy_outbound))
self.config.append(json_template)

def render(self):
Expand Down
132 changes: 52 additions & 80 deletions app/templates/v2ray/default.json
Original file line number Diff line number Diff line change
@@ -1,86 +1,58 @@
{
"log": {
"access": "",
"error": "",
"loglevel": "warning"
},
"inbounds": [
{
"tag": "socks",
"port": 10808,
"listen": "0.0.0.0",
"protocol": "socks",
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
],
"routeOnly": false
},
"settings": {
"auth": "noauth",
"udp": true,
"allowTransparent": false
}
"log": {
"access": "",
"error": "",
"loglevel": "warning"
},
"inbounds": [
{
"tag": "socks",
"port": 10808,
"listen": "0.0.0.0",
"protocol": "socks",
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
],
"routeOnly": false
},
{
"tag": "http",
"port": 10809,
"listen": "0.0.0.0",
"protocol": "http",
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
],
"routeOnly": false
},
"settings": {
"auth": "noauth",
"udp": true,
"allowTransparent": false
}
"settings": {
"auth": "noauth",
"udp": true,
"allowTransparent": false
}
],
"outbounds": [
{
"tag": "direct",
"protocol": "freedom",
"settings": {}
},
{
"tag": "http",
"port": 10809,
"listen": "0.0.0.0",
"protocol": "http",
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
],
"routeOnly": false
},
{
"tag": "block",
"protocol": "blackhole",
"settings": {
"response": {
"type": "http"
}
}
"settings": {
"auth": "noauth",
"udp": true,
"allowTransparent": false
}
],
"dns": {
"servers": [
"1.1.1.1",
"8.8.8.8"
]
},
"routing": {
"domainStrategy": "AsIs",
"rules": [
{
"type": "field",
"inboundTag": [
"api"
],
"outboundTag": "api"
},
{
"type": "field",
"port": "0-65535",
"outboundTag": "proxy"
}
]
}
}
],
"outbounds": [],
"dns": {
"servers": [
"1.1.1.1",
"8.8.8.8"
]
},
"routing": {
"domainStrategy": "AsIs",
"rules": []
}
}

0 comments on commit d3137a1

Please sign in to comment.