fscarmen / warp-sh

WARP script is move to: https://gitlab.com/fscarmen/warp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

xray目录下的conf文件夹现以修改,已无/etc/v2ray-agent/xray/conf/10_ipv4_outbounds.json这一路径

Hank24Z opened this issue · comments

想利用配置文件进行网站分流时发现现在的v2ray八合一版本安装后没有这条路径了,应该是分成了两个配置文件,但是按照文章内方法分开进行修改也没法正常分流,求解。
屏幕截图 2024-02-28 213534
这是09_routing.json的内容
屏幕截图 2024-02-28 213611
这是z_direct_outbound.json的内容
屏幕截图 2024-02-28 213646

这里提到方案还是可用的,至于八合一变动后如何跟进,建议你试下,问问同使用的用户了,我没安装

这里提到方案还是可用的,至于八合一变动后如何跟进,建议你试下,问问同使用的用户了,我没安装

好的

我印象中八合一也拿warp解锁的啊,没有集成到脚本里吗?

我印象中八合一也拿warp解锁的啊,没有集成到脚本里吗?

可以脚本解锁的,只是装了八合一之后没法正常访问bing,想通过分流网站的方式来实现代理访问

我印象中八合一也拿warp解锁的啊,没有集成到脚本里吗?

我今天也遇到这个问题了,八合一那边好像没法去刷ip然后我就想结合本项目一起用,研究了一阵子发现八合一现在自带一个socks5的分流设置,但是他那边必须设置sock出站的账号和密码,然后我发现把那边配置之后,手动到socks5_outbound.json里面删掉账号密码好像还是不行,压根就没分流出去,又试了下改warp-sh的proxy.conf手动加上账号密码,结果加完之后获取不到IP了。。现在就很尴尬

我安装了八合一看了一下,现在已经拆为 /etc/v2ray-agent/xray/conf/09_routing.json 和 /etc/v2ray-agent/xray/conf/z_direct_outbound.json

按这样处理吧

修改配置文件

cp /etc/v2ray-agent/xray/conf/09_routing.json{,.bak}   # 备份该文件
cp /etc/v2ray-agent/xray/conf/z_direct_outbound.json{,.bak}     # 备份该文件

cat > /etc/v2ray-agent/xray/conf/09_routing.json << EOF
{
    "routing": {
        "rules": [
            {
                "type": "field",
                "domain": [
                    "*"
                ],
                "outboundTag": "WARP-interface-v4"
            },
            {
                "type": "field",
                "domain": [
                    "geosite:openai"
                ],
                "outboundTag": "WARP-interface-v6"
            },
            {
                "type": "field",
                "domain": [
                    "domain:gstatic.com",
                    "domain:googleapis.com"
                ],
                "outboundTag": "z_direct_outbound"
            }
        ]
    }
}
EOF


cat > /etc/v2ray-agent/xray/conf/z_direct_outbound.json << EOF
{
    "outbounds": [
        {
            "protocol": "freedom",
            "settings": {
                "domainStrategy": "UseIP"
            },
            "tag": "z_direct_outbound"
        },
        {
            "tag": "WARP-interface-v4",
            "protocol": "freedom",
            "settings": {
                "domainStrategy": "UseIPv4"
            },
            "streamSettings": {
                "sockopt": {
                    "interface": "warp",
                    "tcpFastOpen": true
                }
            }
        },
        {
            "tag": "WARP-interface-v6",
            "protocol": "freedom",
            "settings": {
                "domainStrategy": "UseIPv6"
            },
            "streamSettings": {
                "sockopt": {
                    "interface": "warp",
                    "tcpFastOpen": true
                }
            }
        }
    ]
}
EOF

重启 xray

vasma - 16.core管理 - 1.Xray-core - 6.重启Xray-core

访问 openai 看看

浏览器访问 https://chat.openai.com/cdn-cgi/trace 看看 IP。

image

谢谢,我这成功了,虽然没用你这种方式,我还是用的八合一里面11->4->1->1这种方式安装的socks5出站,虽然要设置账号密码,但是设置完之后在配置文件里面删除就行了。

现在还有个新问题,就是warp这边刷不出来ip,ip.gs里面又有显示有ipv6,非常的奇怪,不清楚啥问题@fscarmen
image
image
image
image

现在还有个新问题,就是warp这边刷不出来ip,ip.gs里面又有显示有ipv6,非常的奇怪,不清楚啥问题

这个我也判断不出来,要运行 bash -x warp 查查为什么没有 IPv6
你可以先试试通过这个能不能查到 IPv6 curl -ks6m5 -A Mozilla https://api.ip.sb/geoip,像如下

# curl -ks6m5  -A Mozilla  https://api.ip.sb/geoip
{"organization":"Hop One Networks","longitude":-97.822,"timezone":"America\/Chicago","isp":"Hop One Networks","offset":-21600,"asn":397391,"asn_organization":"HON-ASN","country":"United States","ip":"2605:7d40:0:24:b7dc:5d99:db8e:f2b8","latitude":37.751,"continent_code":"NA","country_code":"US"}

这个我也判断不出来,要运行 bash -x warp 查查为什么没有 IPv6 你可以先试试通过这个能不能查到 IPv6 curl -ks6m5 -A Mozilla https://api.ip.sb/geoip

@fscarmen 这个是 bash -x warp 的结果

+ systemctl restart wireproxy
+ sleep 3
+ true
+ ((  i++  ))
++ date +%s
+ ip_now=1711465943
+ RUNTIME=33
+ DAY=0
+ HOUR=0
+ MIN=0
+ SEC=33
+ ip_case 6 wireproxy
+ local CHECK_46=6
+ '[' -n wireproxy ']'
+ local CHECK_TYPE=wireproxy
+ '[' '' = non-global ']'
+ '[' wireproxy = warp ']'
+ '[' wireproxy = wireproxy ']'
+ unset WIREPROXY_SOCKS5 WIREPROXY_PORT
++ ss -nltp
++ awk '/"wireproxy"/{print $4}'
+ WIREPROXY_SOCKS5=127.0.0.1:40000
++ cut -d: -f2
+ WIREPROXY_PORT=40000
+ case "$CHECK_46" in
+ fetch_6
+ unset IP_RESULT6 WIREPROXY_TRACE6 WIREPROXY_WAN6 WIREPROXY_COUNTRY6 WIREPROXY_ASNORG6 ACCOUNT QUOTA AC
++ ip_info 6 40000
++ local CHECK_46=6
++ [[ 40000 =~ ^[0-9]+$ ]]
++ local 'INTERFACE_SOCK5=-x socks5://127.0.0.1:40000'
++ case "$CHECK_46" in
++ CHOOSE_IP_API=https://api.ip.sb/geoip
++ CHOOSE_IP_ISP=isp
++ CHOOSE_IP_KEY=ip
+++ curl --retry 2 -ks6m5 -x socks5://127.0.0.1:40000 https://www.who.int/cdn-cgi/trace
+++ sed s/warp=//g
+++ grep warp
++ IP_TRACE=
++ '[' -n '' ']'
++ echo -e 'trace=@\nip=@\ncountry=@\nasnorg=\n'
+ local 'IP_RESULT6=trace=@
ip=@
country=@
asnorg='
++ expr 'trace=@
ip=@
country=@
asnorg=' : '.*trace=\([^@]*\).*'
+ WIREPROXY_TRACE6=
++ expr 'trace=@
ip=@
country=@
asnorg=' : '.*ip=\([^@]*\).*'
+ WIREPROXY_WAN6=
++ expr 'trace=@
ip=@
country=@
asnorg=' : '.*country=\([^@]*\).*'
+ WIREPROXY_COUNTRY6=
+ '[' C = C ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
++ expr 'trace=@
ip=@
country=@
asnorg=' : '.*asnorg=\([^@]*\).*'
+ WIREPROXY_ASNORG6=
+ WIREPROXY_ACCOUNT=' Free'
++ eval echo '$WIREPROXY_TRACE6'
+++ echo
+ '[' '' = plus ']'
++ eval echo '$WIREPROXY_WAN6'
+++ echo
+ WAN=
++ eval echo '$WIREPROXY_ASNORG6'
+++ echo
+ ASNORG=
++ eval echo '$WIREPROXY_COUNTRY6'
+++ echo
+ COUNTRY=
+ unset RESULT REGION
+ (( l=0 ))
+ (( l<2 ))
++ curl --user-agent 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36' -6 -sx socks5h://127.0.0.1:40000 -fsL --write-out '%{http_code}' --output /dev/null --max-time 10 https://www.netflix.com/title/81280792
+ RESULT[l]=000
+ '[' 000 = 200 ']'
+ (( l++ ))
+ (( l<2 ))
++ curl --user-agent 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36' -6 -sx socks5h://127.0.0.1:40000 -fsL --write-out '%{http_code}' --output /dev/null --max-time 10 https://www.netflix.com/title/70143836
+ RESULT[l]=000
+ '[' 000 = 200 ']'
+ (( l++ ))
+ (( l<2 ))
+ [[ 000 000 =~ 200 ]]
+ wireproxy_restart
++ text 126
++ grep -q '\$'
++ eval echo '$(eval echo ${C[126]})'
++++ eval echo '$(date' '+'\''%F' '%T'\'')' '尝试第${i}次,解锁失败,IPv$NF:' '$WAN' '$COUNTRY' '$ASNORG,${j}秒后重新测试,刷' IP 运行时长: '$DAY' 天 '$HOUR' 时 '$MIN' 分 '$SEC' 秒
++++++ date '+%F %T'
+++++ echo 2024-03-26 23:12:24 尝试第8次,解锁失败,IPv6: ,3秒后重新测试,刷 IP 运行时长: 0 天 0 时 0 分 33 秒
+++ echo 2024-03-26 23:12:24 尝试第8次,解锁失败,IPv6: ,3秒后重新测试,刷 IP 运行时长: 0 天 0 时 0 分 33 秒
+ warning ' 2024-03-26 23:12:24 尝试第8次,解锁失败,IPv6: ,3秒后重新测试,刷 IP 运行时长: 0 天 0 时 0 分 33 秒 '
+ echo -e '\033[31m\033[01m 2024-03-26 23:12:24 尝试第8次,解锁失败,IPv6: ,3秒后重新测试,刷 IP 运行时长: 0 天 0 时 0 分 33 秒 \033[0m'
 2024-03-26 23:12:24 尝试第8次,解锁失败,IPv6: ,3秒后重新测试,刷 IP 运行时长: 0 天 0 时 0 分 33 秒 
+ systemctl restart wireproxy
+ sleep 3

下面这个没有内容

root@glowing-echo-1:~# curl -ks6m5 -A Mozilla https://api.ip.sb/geoip
root@glowing-echo-1:~# curl -ks6m5 -A Mozilla https://api.ip.sb/geoip

可以了,你再试试
image

我安装了八合一看了一下,现在已经拆为 /etc/v2ray-agent/xray/conf/09_routing.json 和 /etc/v2ray-agent/xray/conf/z_direct_outbound.json

按这样处理吧

修改配置文件

cp /etc/v2ray-agent/xray/conf/09_routing.json{,.bak}   # 备份该文件
cp /etc/v2ray-agent/xray/conf/z_direct_outbound.json{,.bak}     # 备份该文件

cat > /etc/v2ray-agent/xray/conf/09_routing.json << EOF
{
    "routing": {
        "rules": [
            {
                "type": "field",
                "domain": [
                    "*"
                ],
                "outboundTag": "WARP-interface-v4"
            },
            {
                "type": "field",
                "domain": [
                    "geosite:openai"
                ],
                "outboundTag": "WARP-interface-v6"
            },
            {
                "type": "field",
                "domain": [
                    "domain:gstatic.com",
                    "domain:googleapis.com"
                ],
                "outboundTag": "z_direct_outbound"
            }
        ]
    }
}
EOF


cat > /etc/v2ray-agent/xray/conf/z_direct_outbound.json << EOF
{
    "outbounds": [
        {
            "protocol": "freedom",
            "settings": {
                "domainStrategy": "UseIP"
            },
            "tag": "z_direct_outbound"
        },
        {
            "tag": "WARP-interface-v4",
            "protocol": "freedom",
            "settings": {
                "domainStrategy": "UseIPv4"
            },
            "streamSettings": {
                "sockopt": {
                    "interface": "warp",
                    "tcpFastOpen": true
                }
            }
        },
        {
            "tag": "WARP-interface-v6",
            "protocol": "freedom",
            "settings": {
                "domainStrategy": "UseIPv6"
            },
            "streamSettings": {
                "sockopt": {
                    "interface": "warp",
                    "tcpFastOpen": true
                }
            }
        }
    ]
}
EOF

重启 xray

vasma - 16.core管理 - 1.Xray-core - 6.重启Xray-core

访问 openai 看看

浏览器访问 https://chat.openai.com/cdn-cgi/trace 看看 IP。

image

好的,感谢

可以试试 sing-box 一键脚本,功能更多

bash <(wget -qO- https://raw.githubusercontent.com/fscarmen/sing-box/main/sing-box.sh)