V2ray-core: [solved]一个进程可以同时开socks与http吗?

Created on 1 May 2016  ·  9Comments  ·  Source: v2ray/v2ray-core

RT,inbound 与 inboundDetour。

Most helpful comment

InboundDetour 最外层是一个 [ ]。

{
    "port": 3786,
    "log": {
        "access": ""
    },
    "inbound": {
        "protocol": "socks",
        "settings": {
            "auth": "noauth",
            "udp": false,
            "ip": "0.0.0.0"
        }
    },
    "inboundDetour": [{
        "protocol": "http",
        "port": 8080,
        "settings": {}
    }],
    "outbound": {
        "protocol": "vmess",
        "settings": {
            "vnext": [
                {
                    "address": "1.2.3.4",
                    "port": 443,
                    "users": [
                        {
                            "id": "xxxxxxx-xxxx-xxxx-xxxxxxxx",
                            "alterId": 100
                        }
                    ]
                }
            ]
        }
    },
    "outboundDetour": [
        {
            "protocol": "freedom",
            "settings": {},
            "tag": "direct"
        }
    ],
    "routing": {
        "strategy": "rules",
        "settings": {
            "rules": [
                {
                    "type": "field",
                    "ip": [
                        "0.0.0.0/8",
                        "10.0.0.0/8",
                        "100.64.0.0/10",
                        "127.0.0.0/8",
                        "169.254.0.0/16",
                        "172.16.0.0/12",
                        "192.0.0.0/24",
                        "192.0.2.0/24",
                        "192.168.0.0/16",
                        "198.18.0.0/15",
                        "198.51.100.0/24",
                        "203.0.113.0/24",
                        "::1/128",
                        "fc00::/7",
                        "fe80::/10"
                    ],
                    "outboundTag": "direct"
                }
            ]
        }
    }
}

All 9 comments

可以的

@v2ray (http)inbound 与 (socks)inboundDetour 还是(socks)inbound 与 (http)inboundDetour?

没有区别。inbound 有且只能有一个,inboundDetour 可以有多个,怎么写方便就怎么写。

@v2ray http 与 socks 的端口怎么写?这么调试都不通过……求助。

{
    "port": 80,
    "log": {
        "access": ""
    },
    "inbound": {
        "protocol": "socks",
        "settings": {
            "auth": "noauth",
            "udp": false,
            "ip": "0.0.0.0",
            "port": 1080
        }
    },
    "inboundDetour": {
        "protocol": "http",
        "settings": {}
    },

... ... ... ...

Socks 的 settings 中没有 port 选项,猜测你把 http 的 port 搞混了。另外部份操作系统不允许监听1000以下的端口。

大概应该是这样:

{
    "port": 1080,
    "log": {
        "access": ""
    },
    "inbound": {
        "protocol": "socks",
        "settings": {
            "auth": "noauth",
            "udp": false,
            "ip": "0.0.0.0"
        }
    },
    "inboundDetour": {
        "protocol": "http",
        "port": 8080,
        "settings": {}
    },

还是不行……

D:\v2ray>v2ray.exe
V2Ray v1.11.2 (New Order) 20160419
An unified platform for anti-censorship.
2016/05/01 23:30:03 [Error]Failed to load server config: json: cannot unmarshal
object into Go value of type []_point.InboundDetourConfig
2016/05/01 23:30:03 [Error]Failed to read config file (D:\v2rayconfig.json): D:
\v2rayconfig.jsonjson: cannot unmarshal object into Go value of type []_point.I

nboundDetourConfig

{
"port": 3786,
"log": {
"access": ""
},
"inbound": {
"protocol": "socks",
"settings": {
"auth": "noauth",
"udp": false,
"ip": "0.0.0.0"
}
},
"inboundDetour": {
"protocol": "http",
"port": 8080,
"settings": {}
},
"outbound": {
"protocol": "vmess",
"settings": {
"vnext": [
{
"address": "1.2.3.4",
"port": 443,
"users": [
{
"id": "xxxxxxx-xxxx-xxxx-xxxxxxxx",
"alterId": 100
}
]
}
]
}
},
"outboundDetour": [
{
"protocol": "freedom",
"settings": {},
"tag": "direct"
}
],
"routing": {
"strategy": "rules",
"settings": {
"rules": [
{
"type": "field",
"ip": [
"0.0.0.0/8",
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10"
],
"outboundTag": "direct"
}
]
}
}
}

InboundDetour 最外层是一个 [ ]。

{
    "port": 3786,
    "log": {
        "access": ""
    },
    "inbound": {
        "protocol": "socks",
        "settings": {
            "auth": "noauth",
            "udp": false,
            "ip": "0.0.0.0"
        }
    },
    "inboundDetour": [{
        "protocol": "http",
        "port": 8080,
        "settings": {}
    }],
    "outbound": {
        "protocol": "vmess",
        "settings": {
            "vnext": [
                {
                    "address": "1.2.3.4",
                    "port": 443,
                    "users": [
                        {
                            "id": "xxxxxxx-xxxx-xxxx-xxxxxxxx",
                            "alterId": 100
                        }
                    ]
                }
            ]
        }
    },
    "outboundDetour": [
        {
            "protocol": "freedom",
            "settings": {},
            "tag": "direct"
        }
    ],
    "routing": {
        "strategy": "rules",
        "settings": {
            "rules": [
                {
                    "type": "field",
                    "ip": [
                        "0.0.0.0/8",
                        "10.0.0.0/8",
                        "100.64.0.0/10",
                        "127.0.0.0/8",
                        "169.254.0.0/16",
                        "172.16.0.0/12",
                        "192.0.0.0/24",
                        "192.0.2.0/24",
                        "192.168.0.0/16",
                        "198.18.0.0/15",
                        "198.51.100.0/24",
                        "203.0.113.0/24",
                        "::1/128",
                        "fc00::/7",
                        "fe80::/10"
                    ],
                    "outboundTag": "direct"
                }
            ]
        }
    }
}

@v2ray 明白了。感谢!

Was this page helpful?
0 / 5 - 0 ratings