v2ray / discussion

For general discussion over Project V development and usage.
299 stars 34 forks source link

请问是否支持socks5的前置代理(outbounds vmess over sokcs5) #129

Closed CodeCrazy-guy closed 5 years ago

CodeCrazy-guy commented 5 years ago

我使用以下配置测试不通过。

v2ray报outbounds 转发错误,

"inbounds": [{
    "port": 1080,
    "listen": "127.0.0.1",
    "protocol": "socks",
    "sniffing": {
        "enabled": true,
        "destOverride": [
            "http",
            "tls"
        ]
    },
    "settings": {
        "auth": "noauth",
        "udp": true,
        "ip": null,
        "clients": null
    },
    "streamSettings": null
}],
"outbounds": [{
        "tag": "transit",
        "protocol": "vmess",
        "settings": {
            "vnext": [{
                "address": "xxx",
                "port": 443,
                "users": [{
                    "id": "xxx",
                    "alterId": 0,
                    "email": "t@t.tt",
                    "security": "aes-128-gcm"
                }]
            }],
            "servers": null,
            "response": null
        },
        "streamSettings": {
            "network": "ws",
            "security": "tls",
            "tlsSettings": {
                "allowInsecure": true,
                "serverName": null
            },
            "tcpSettings": null,
            "kcpSettings": null,
            "wsSettings": {
                "connectionReuse": true,
                "path": "/ray2",
                "headers": {
                    "Host": "xxx"
                }
            },
            "httpSettings": null
        },
        "mux": {
            "enabled": false
        },
        "proxySettings": {
            "tag": "transit"
        }
    },
    {
        "protocol": "socks",
        "settings": {
            "servers": [{
                "address": "123.123.123.123",
                "port": 1080
            }]
        },
        "tag": "transit"
    },
    {
        "tag": "direct",
        "protocol": "freedom",
        "settings": {
            "vnext": null,
            "servers": null,
            "response": null
        },
        "streamSettings": null,
        "mux": null
    },
    {
        "tag": "block",
        "protocol": "blackhole",
        "settings": {
            "vnext": null,
            "servers": null,
            "response": {
                "type": "http"
            }
        },
        "streamSettings": null,
        "mux": null
    }
],

首先,我想使用一个纯socks5服务器作为跳板(并非v2ray或shadowsocks),这个socks5服务器不包含用户名密码。 可以看到我在outbounds 的vemss设置下面添加了一个tag 指向 transit

并且在tag的下方新添加了一个协议socks(不知道这样写对不对或者应该写成socks5?),然后对应填写了port和address。

这个前置代理设置在v2ray上测试不通过。

但是在shadowsocksr上面配置前置代理测试通过。

是v2ray不支持socks5协议的前置代理吗?

谢谢!

CodeCrazy-guy commented 5 years ago

v2ray 版本4.13

youwei5683 commented 5 years ago

V2RAY 默认支持 socks5 不知道你具体要实现啥。请描述清楚

CodeCrazy-guy commented 5 years ago

V2RAY 默认支持 socks5 不知道你具体要实现啥。请描述清楚

我的意思是,在v2ray添加前置代理。

类似SS的前置代理一样。 使用socks5服务器作为中转

比如以下这个例子: 直连(tcp+ws+tls): CN =>> USA 中转(tcp+ws+tls): CN=>>CN2=>>USA

v2ray的文档中只介绍了基于v2ray和shadowsocks的中转方案。

我想问是否支持socks5协议的中转,就是中转服务器上不使用v2ray和shadowsocks

CodeCrazy-guy commented 5 years ago

V2RAY 默认支持 socks5 不知道你具体要实现啥。请描述清楚

这里是我找到的文档: https://toutyrater.github.io/advanced/outboundproxy.html

tjLEIIQM3 commented 5 years ago

参考: https://github.com/v2ray/discussion/issues/51 https://kirikira.moe/post/26/#2

和你的配置不同的地方是他用了个dokodemo-door,把vmess和socks连接起来。 不过我没有这样的测试环境,所以不确定是不是真的能用。

CodeCrazy-guy commented 5 years ago

参考:

51

https://kirikira.moe/post/26/#2

和你的配置不同的地方是他用了个dokodemo-door,把vmess和socks连接起来。 不过我没有这样的测试环境,所以不确定是不是真的能用。

经过测试无效。

仍然是outbounds的流量转发错误。

youwei5683 commented 5 years ago

不知我是否理解正确: 你是想 V2RAY客户端到国外V2RAY服务器在到国外socks5服务器吗? 是可以实现的

CodeCrazy-guy commented 5 years ago

不知我是否理解正确: 你是想 V2RAY客户端到国外V2RAY服务器在到国外socks5服务器吗? 是可以实现的

dalao你好

我的意思是,local国内 -> socks5国内 -> v2ray server国外 - > youtube国外

youwei5683 commented 5 years ago

https://toutyrater.github.io/advanced/outboundproxy.html 这个文章你参考一下 把 shadowsocks 换成 socks5 其他按格式修改

CodeCrazy-guy commented 5 years ago

https://toutyrater.github.io/advanced/outboundproxy.html 这个文章你参考一下 把 shadowsocks 换成 socks5 其他按格式修改

这个代码在socks5的前置上测试不通过

CodeCrazy-guy commented 5 years ago

@VictoriaRaymond

crazyzq commented 5 years ago

@CodeCrazy-guy 我也在找这个方法,请问你解决 了吗?

Yamazaki-wu commented 5 years ago

@CodeCrazy-guy 我也在找这个方法,自己搭了个国内有验证的S5,SSR测试可以正常使用。但是V2完全不知道怎么写。还有我是用v2rayN的GUI客户端,估计能配置的话,应该是直接用命令方式实现吧?

phantomedc commented 5 years ago

我也面临这个问题,mark

stallr commented 5 years ago

@CodeCrazy-guy 我也在找这个方法,自己搭了个国内有验证的S5,SSR测试可以正常使用。但是V2完全不知道怎么写。还有我是用v2rayN的GUI客户端,估计能配置的话,应该是直接用命令方式实现吧?

请问你这个怎么实现?可以指点下吗, 我需要的是 国内socks5 连接 国内的socks5通过ssr 中转到 的国外的ssr

Yamazaki-wu commented 5 years ago

@CodeCrazy-guy 我也在找这个方法,自己搭了个国内有验证的S5,SSR测试可以正常使用。但是V2完全不知道怎么写。还有我是用v2rayN的GUI客户端,估计能配置的话,应该是直接用命令方式实现吧?

请问你这个怎么实现?可以指点下吗, 我需要的是 国内socks5 连接 国内的socks5通过ssr 中转到 的国外的ssr

我已经用了很久了,v2rayN应该不支持,我直接用的v2ray-core

那请问使用v2ray-core + config.json 怎么实现使用socks5来中转代理的?

Yamazaki-wu commented 5 years ago

哪里有相关教程可以看看么?

Shuo notifications@github.com 於 2019年8月28日 週三 下午4:38寫道:

@CodeCrazy-guy https://github.com/CodeCrazy-guy 我也在找这个方法,自己搭了个国内有验证的S5,SSR测试可以正常使用。但是V2完全不知道怎么写。还有我是用v2rayN的GUI客户端,估计能配置的话,应该是直接用命令方式实现吧?

请问你这个怎么实现?可以指点下吗, 我需要的是 国内socks5 连接 国内的socks5通过ssr 中转到 的国外的ssr

我已经用了很久了,v2rayN应该不支持,我直接用的v2ray-core

那请问使用v2ray-core + config.json 怎么实现使用socks5来中转代理的?

朴素tcp可以直接用proxySettings实现,设置一个outbound指到你的socks5,并把这个outbound的tag作为vmess outbound的proxySettings,如果你是其他协议比如ws+tls这种,就需要用到dokodemo-door了,这个稍微复杂不展开讲了。

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/v2ray/discussion/issues/129?email_source=notifications&email_token=ADD2JZ5FL4WDZF7TGULFNJ3QGY2RDA5CNFSM4GS3KAX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5KK66I#issuecomment-525643641, or mute the thread https://github.com/notifications/unsubscribe-auth/ADD2JZ3UDCJIWL4GNZEXDF3QGY2RDANCNFSM4GS3KAXQ .

Yamazaki-wu commented 4 years ago

@CodeCrazy-guy @phantomedc @crazyzq @ceakevew 我从其他地方的 Issues 找到了解决方法,先来确认一下你们的要求是否跟我的一致,晚上到家把配置贴出来。 我的需求是:家里电信线路使用V2-core客户端——国内联通线路VPS搭建了纯socks5中转、有验证且可以自己更改VPS相关设置——公益、机场提供的V2 server配置不能变更。 最终实现国内socks中转达到加速目的,因为有些V2节点亲和联通(本人家里电信)。

phantomedc commented 4 years ago

resolved v2ray/v2ray-core#1736

Yamazaki-wu commented 4 years ago

哦,原来哪个Issues是你写的,我没注意呢。感谢你的帮助!纯socks中转的帖子还真心难找。

k79e commented 4 years ago

代理链 第一个写s5 第二个vmess 应该就行了

原来如此 任意门就是把出站变回入站 然后就可以被路由调用了.....

那所以到时候http出来时候也那样用就行了!!

天哪代理链我不会用 谁给我讲解下

408463202 commented 2 years ago

如何联系你,我想让你帮我做个东西,有偿

doufuvpn commented 2 years ago

不知我是否理解正确: 你是想 V2RAY客户端到国外V2RAY服务器在到国外socks5服务器吗? 是可以实现的

大佬,我购买了socks 有ip和账户密码,不能登陆主机,能实现你说的这种方法。