v2ray / v2ray-core

A platform for building proxies to bypass network restrictions.
https://www.v2ray.com/
MIT License
45.29k stars 8.94k forks source link

ubuntu 18.06 LTS 如何实现终端翻墙 #2009

Closed NEWgaofeng closed 4 years ago

NEWgaofeng commented 4 years ago

Please answer all the questions with enough information. All issues not following this template will be closed immediately. If you are not sure if your question is truely a bug in V2Ray, please discuss it here first.

1) What version of V2Ray are you using (If you deploy different version on server and client, please explicitly point out)?

2) What's your scenario of using V2Ray? E.g., Watching YouTube videos in Chrome via Socks/VMess proxy.

3) Please attach full panic log.

You may get panic log using command journalctl -u v2ray if your system is Linux (systemd).

4) Please attach your configuration file (Mask IP addresses before submit this issue).

    // Please attach your configuration here.

Please review your issue before submitting. 我的config.json { "log": { "access": "", "error": "", "loglevel": "warning" }, "inbound": { "port": 1080, "listen": "127.0.0.1", "protocol": "socks", "sniffing": { "enabled": true, "destOverride": [ "http", "tls" ] }, "settings": { "auth": "noauth", "udp": true, "ip": "127.0.0.1", "clients": null }, "streamSettings": null }, "outbound": { "tag": "agentout", "protocol": "vmess", "settings": { "vnext": [ { "address": "sz-special-xx-1.lanan.world", "port": 33333, "users": [ { "id": "1ca22f7d-xxxxxxxxxxxxx-c5c3ff1de278", "alterId": 2, "email": "t@t.tt", "security": "aes-128-gcm" } ] } ], "servers": null }, "streamSettings": { "network": "tcp", "security": "", "tlsSettings": null, "tcpSettings": null, "kcpSettings": null, "wsSettings": null, "httpSettings": null }, "mux": { "enabled": true } }, "inboundDetour": null, "outboundDetour": [ { "protocol": "freedom", "settings": { "response": null }, "tag": "direct" }, { "protocol": "blackhole", "settings": { "response": { "type": "http" } }, "tag": "blockout" } ], "dns": { "servers": [ "8.8.8.8", "8.8.4.4", "localhost" ] }, "routing": { "strategy": "rules", "settings": { "domainStrategy": "IPIfNonMatch", "rules": [ { "type": "field", "port": null, "outboundTag": "direct", "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" ], "domain": null } ] } } }


启动v2ray之后,我用谷歌浏览器安装了switch插件 实现的访问谷歌. 但是我最近在学习kubernetes 下载一些镜像,需要实现终端翻墙. 求助一下,各位大佬,感谢!

UJX6N commented 4 years ago

k8s走的http协议吧。那......

inbound从socks模式改成http模式(或者加一个其他端口的http模式inbound),然后在终端里

export http_proxy="127.0.0.1:1080" export https_proxy="127.0.0.1:1080"

NEWgaofeng commented 4 years ago

我做了如下操作: 1.将v2ray修改为http方式 2.在swith的proxy修改成http 浏览器还是可以访问谷歌的 3.export http_proxy="127.0.0.1:8080" export https_proxy="127.0.0.1:8080" 最后进行测试:结果如下

curl www.google.com <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

503 - Forwarding failure (Privoxy@localhost)