v2ray高级配置

2020年7月29日

最基本的v2ray配置文件

{
	"log": {
		"loglevel": "info"
	},
	"inbound": {
		"protocol": "socks",
		"listen": "0.0.0.0",
		"port": 10000, //这里要填写你打算在本地开放的socks代理端口
		"settings": {
			"auth": "noauth",
			"udp": true,
			"timeout": 30
		}
	},
	"outbounds": [
		{
			"protocol": "shadowsocks",
			"settings": {
				"servers": [
					{
						"address": "gqqnbig.me",
						"port": 31313,
						"method": "chacha20-poly1305",
						"password": "小熊维尼",
						"ota": false,
						"level": 0
					}
				]
			},
			"streamSettings": {},
			"mux": {
				"enabled": false,
				"concurrency": 8
			},
			"tag": "proxy"
		},
		{
			"protocol": "freedom",
			"settings": {},
			"tag": "direct"
		},
		{
			"protocol": "blackhole",
			"settings": {},
			"tag": "block"
		}
	]
}

把以上代码存为a.json,运行 v2ray.exe -config “B:\a.json”

网上配置的都是inbounds属性,要求数组,但实际上inbound就可以。

v2ray配置shadowsocks+插件

用shadowsocks-windows图形化客户端配置shadowsocks obfs插件

shadowsocks-windows图形化客户端可以配置shadowsocks插件,比如较早的simple-obfs和现在的v2ray-plugin。图一的插件程序是obfs-local,程序就会在当前目录运行obfs-local.exe。shadowsocks插件的作用原理是,在shadowsocks协议外再包上一层新协议。流程如下:

浏览器 --> 纯shadowsocks --> obfs --> GFW

v2ray作为更先进的翻墙平台,当然支持shadowsocks插件。

按照 https://github.com/v2ray/v2ray-core/issues/485#issuecomment-451730533 的提示,先用命令行运行obfs。图一的配置转换为命令行如下:

>obfs-local.exe -s c321s2.jamjams.net -p 39238 -l 19863 --obfs tls --obfs-host www.bing.com
2020-07-30 13:06:42 [simple-obfs] INFO: obfuscating enabled
2020-07-30 13:06:42 [simple-obfs] INFO: obfuscating hostname: www.bing.com
2020-07-30 13:06:42 [simple-obfs] INFO: listening at 127.0.0.1:19863

这里打开了本地端口19863,用来接收上层的纯shadowsocks封包。

接下来配置v2ray,配置文件如下。


{
	"log": {
		"loglevel": "info"
	},
	"inbound": {
		"protocol": "socks",
		"listen": "0.0.0.0",
		"port": 10000, //这里要填写你打算在本地开放的socks代理端口
		"settings": {
			"auth": "noauth",
			"udp": true,
			"timeout": 30
		}
	},
	"outbounds": [
		{
			"protocol": "shadowsocks",
			"settings": {
				"servers": [
					{
						"address": "127.0.0.1",
						"port": 19863,
						"method": "aes-256-gcm",
						"password": "*******",
						"ota": false,
						"level": 0
					}
				]
			},
			"streamSettings": {},
			"mux": {
				"enabled": false,
				"concurrency": 8
			},
			"tag": "proxy"
		},
		{
			"protocol": "freedom",
			"settings": {},
			"tag": "direct"
		},
		{
			"protocol": "blackhole",
			"settings": {},
			"tag": "block"
		}
	]
}

以上配置可以导入v2rayN图形化客户端,但很遗憾v2rayN不能对自定义配置测速。