Project V 如何配置 http 代理

in v2ray •  7 years ago 

查阅文档:Project V http协议介绍 可得知,PV是支持 http inbound 的。由于我已经配置了一个 socks inbound 了,所以此处需要使用 inboundDetour 来实现多个 inbound。

贴一下配置文件:

{
"inbound": {
        "port": 1081,
        "listen": "127.0.0.1",
        "protocol": "socks",
        "settings": {
            "auth": "noauth",
            "udp": false,
            "ip": "127.0.0.1"
        }
    },
    "inboundDetour": [{
        "port": 1082,
        "listen": "127.0.0.1",
        "protocol": "http",
        "settings": {
            "timeout": 300,
            "accounts": [{
                "user": "myUsername",
                "pass": "myPassword"
            }],
            "allowTransparent": false,
            "userLevel": 0
        }
    }],
    "outbound": {
        ...
    },
    "outboundDetour": {
        ...
    },
    "routing": {
        ...
    }
}

其中:

  • timeout (V2Ray 3.1 后等价于对应用户等级的 connIdle 策略): 从客户端读取数据的超时设置(秒),0 表示不限时。默认值为 300。
  • accounts 一个数组,数组中每个元素为一个用户帐号,用户名由user指定,密码由pass指定。默认值为空。当 accounts 非空时,HTTP 代理将对传入连接进行 Basic Authentication 验证。
  • allowTransparent 当为true时,会转发所有 HTTP 请求,而非只是代理请求。若配置不当,开启此选项会导致死循环。
  • userLevel 用户等级,所有连接使用这一等级。

第一次配置的时候忘记 inboundDetour 的格式是数组,需要加方括号,导致 json 格式出错,核心无法运行,此处需要注意一下。

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Congratulations @erickwok! You have received a personal award!

1 Year on Steemit
Click on the badge to view your Board of Honor.

Do not miss the last post from @steemitboard:

SteemFest3 and SteemitBoard - Meet the Steemians Contest

Support SteemitBoard's project! Vote for its witness and get one more award!

Congratulations @erickwok! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Do not miss the last post from @steemitboard:

SteemFest Meet The Stemians Contest - The mysterious rule revealed
Vote for @Steemitboard as a witness to get one more award and increased upvotes!