Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

goproxy-vps r168 已经是一个成熟可用的 tls1.3 + http2 代理了。 #1470

Open
phuslu opened this Issue on 4 Feb · 152 comments

Comments

Projects
None yet
Owner

phuslu commented on 4 Feb • edited

项目主页:https://github.com/phuslu/goproxy/tree/server.vps

安装方法:
curl -L git.io/get-goproxy-vps | bash

启动方法:
sudo ./goproxy-vps 或者 sudo ./goproxy-vps.sh start

优势:

  • tls 1.3 的 1-RTT 甚至 0-RTT 的握手时间,并且根据客户端自动选择 ECC/RSA 证书,根据服务端自动选择 ECDHE_ECDSA/X25519 和 AES-GCM/ChaCha20。
  • http2 多路复用,网页体验明显。
  • autocert 自动使用 letsencrypt 的 tls-sni 协议签发证书,这样就可以无痛部署了。
  • 向下兼容 https proxy, 所以 iOS 上的 wingy, surge 也能用了。
  • 客户端普通的非代理请求可以反代本地 nginx/apache 的 80 端口,使 443 端口不至于只能用作代理。
  • proxy auth 使用是 linux 的 PAM 机制或 htpasswd 文件,便于管理。同时也支持客户端证书验证来对抗 TLS 探针。
  • golang 实现,效率较高,部署简单。

使用注意点:

  • Chrome 请务必打开 chrome://flags/#ssl-version-max 的 tls1.3 支持。
  • Firefox 请务必打开 security.tls.version.max = 4 和 security.tls.enable_0rtt_data = true
  • VPS 请尽可能打开 TCP BBR 算法。
  • 某些网络环境对 http2 有限速,请改用 [[https]] 配置。

跳票许久,大家就请随便用用吧。

wpyok500 commented on 4 Feb

没vps

cannanlly commented on 4 Feb

谷歌有提供付费vps服务吗?谁知道?

hcym commented on 4 Feb

这得追随vps了

gxggsrmyy commented on 5 Feb

@phuslu 客户端要怎么没置呢?在vps.json中怎么设置,在http.json中要设置关于vps的信息吗?proxy auth 用户名密码怎么设置?客户端可以反代nginx的80端囗是什么意思?服务端自带反代功能吗?好多不明白,能不能详细说明一下,怎样打开vps的tcp bbr算法?

gxggsrmyy commented on 5 Feb

服务端的443端口是不是不能更改,因为已经有別的服务占用了

Owner

phuslu commented on 5 Feb

443 端口占用的进程让出来即可。 goproxy-vps 有反代功能,不会浪费 443 端口。

至于如何使用,就留待有缘人了。

在此自夸一句,比市面上的主流方案都有不小的优势。

wz7465 commented on 5 Feb

chrome.exe" --ignore-certificate-errors 开 tls1.3
vps没开bbr
goproxy-vps进程跑起来,代理不成功,难道非要官方证书?

Owner

phuslu commented on 5 Feb • edited

--ignore-certificate-errors 没必要的了,因为 goproxy-vps 会实时地用 letsencrypt 的 API Server 签出合法证书。

不过前提需要给 VPS 绑一个域名(没有域名的话,可以去 3322.org 申请一个)。

更多配置,可见 goproxy-vps.toml.

启动的时候会报一个错误

./goproxy-vps.sh: 48: ./goproxy-vps.sh: realpath: not found
Owner

phuslu commented on 5 Feb • edited

@lizongzeshunshun 有些 linux 的确没有 realpath 命令,已经修复了。

@phuslu 已经正常。谢谢

Owner

phuslu commented on 5 Feb

@wz7465 我试下了你的 wz****.tk 速度还行,如果觉得慢的话,可以同时搭建 ss 比较一下。看看是线路问题,还是 goproxy-vps 本身的问题。

另外,如果要共享使用的话,建议开启 proxy_auth_method = "pam" 这个选项。
这样就使用 linux 自身的账号和密码来做代理认证了。可以方便的使用 adduser/deluser useradd 等命令对用户做增删改。

wz7465 commented on 5 Feb

那应该服务端没问题,我xp无法测,是切换到win10的chrome测试的,win10运行各种怪毛病,平常不用,xp上的代理基本上都流畅的

breakwa11 commented on 5 Feb

哇,支持得真快

Owner

phuslu commented on 5 Feb

@breakwa11 多谢捧场。 😄

用的是 cloudflare 的 tls-tris 补丁,在 https://github.com/phuslu/go/commits/master

不过怎么说呢,捣鼓出来的这玩意有其独特之处。
我不忍明珠蒙尘,但又不愿野人献曝。于是就在 goproxy issues 发发算了,这儿大部分都是 GAE 的用户,对这玩意也是兴趣缺缺,围观一下即可。

breakwa11 commented on 6 Feb

我这边也有计划,但不打算这么早实现

SeaHOH commented on 6 Feb

响应号召,围观围观。 😆

Pauly2015 commented on 6 Feb

请问社长:

  1. 在己经部署了Shadowsocks的VPS上面还可以再部署goproxy-vps吗,会不会冲突
  2. goproxy-vps的性能跟Shadowsocks相比有什么区别
Owner

phuslu commented on 6 Feb • edited

  1. 不会。不过 goproxy-vps 要占用 443 端口。不然只能手动配置证书。
  2. 性能比较这个话题是个口水仗,除了和软件本身有关,和时段,线路,运营商qos,墙的协议过滤都有关系。所以只能自己部署试试。理论上的话,http2 协议的看网页的体验会有优势。

wz7465 commented on 6 Feb

早上又测了一下,速度比昨天快一点了,但只有2m不到,github这里的网页能正常打开,昨天10秒钟打不开,应该是我这里的宽带商对http2做了限制,看下图,同一平台部署的两个代理,速度差别真的很大
111

wz7465 commented on 6 Feb

这是用goproxy-vps 84版本在arukas部署的,用stunnel做的客户端,
222
速度也很好

Owner

phuslu commented on 6 Feb

这不合理啊,你用 stunnel 把你新部署的 goproxy vps 转换以后速度如何?

我这边速度还行,基本与SS原版持平,但是跟SSR还是有差距

测试数据:

Fast.com

  • goproxy-vps 23Mbps
  • ShadowsocksR 56Mbps

Youtube

  • goproxy-vps 2300Kbps~4000Kbps
  • ShadowsocksR 7000~14000Kbps

同时goproxy-vps的Youtube的缓冲与速度统计曲线很不平滑

浏览网页体验确实不错,应该是http/2.0的缘故


  • 所有测试在8:00AM-9:00AM进行
  • 浏览器Google Chrome(Version 56.0.2924.87 (64-bit))(TLS1.3已开启)

wz7465 commented on 6 Feb

新部署的 goproxy vps 版本是146,stunnel没办法接,只能接老的。从我使用的体会来讲,我发现基本上http2速度都很慢,还有绑定官方证书也会受影响,以前我部署了一个网页代理,用平台的自带证书还可以,但是域名不匹配,后来改用了cloudflare提供的证书,干扰明显增加,速度下降不少

Owner

phuslu commented on 6 Feb

goproxy-vps 看视频的体验要达到 ssr 的就得加上客户端了。

两端需要基于 h2c 协议加上 psk 和 obfs 功能。

这个得再等等。

gxggsrmyy commented on 6 Feb

@phuslu vps 的 IP 会不会被封杀?

wangyi2005 commented on 6 Feb

老大,docker alpine:3.5
Configure goproxy-vps
bash: line 106: /dev/tty: No such device or address�[0m

ouyangmland commented on 7 Feb

@breakwa11 第一次看到小姐姐,在社长这里出现

wz7465 commented on 7 Feb

[[http2]]
listen = ":443"
server_name = ["proxy.example.org"]
parent_proxy = "http://127.0.0.1:8080"
proxy_auth_method = "pam"
我看认证好像是默认开启的,用 adduser XX添加了一个用户,重启后,认证没起作用,是不是方法不对

wz7465 commented on 7 Feb

log的一些报错信息
I0207 04:57:30.465847 154 goproxy-vps.go:346] [ 0x0303] 121.10.68.93:59545 "CONNECT s103.cnzz.com:443 HTTP/2.0" - -
I0207 04:57:30.477703 154 resolver.go:81] LookupIP("img0.uploadhouse.com") return [110.232.116.200], err=
I0207 04:57:30.510477 154 resolver.go:81] LookupIP("i68.tinypic.com") return [68.232.35.169], err=
I0207 04:57:31.719190 154 resolver.go:81] LookupIP("ww3.sinaimg.cn") return [174.35.21.101 174.35.21.16], err=
2017/02/07 04:57:42 http: TLS handshake error from 121.10.68.93:21916: EOF
2017/02/07 04:58:30 http: TLS handshake error from 121.10.68.93:47650: EOF

2017/02/07 06:21:36 http2: received GOAWAY [FrameHeader GOAWAY len=8], starting graceful shutdown
2017/02/07 06:22:04 http: TLS handshake error from 121.10.68.93:23884: EOF
I0207 06:22:48.309917 107 goproxy-vps.go:346] [ 0x0303] 121.10.68.93:35354 "CONNECT sync-357-us-west-2.sync.services.mozilla.com:443 HTTP/2.0" - -
2017/02/07 06:22:57 http: TLS handshake error from 121.10.68.93:20938: EOF
I0207 06:22:58.077763 107 goproxy-vps.go:346] [ 0x0303] 121.10.68.93:37947 "CONNECT www.google-analytics.com:443 HTTP/2.0" - -
2017/02/07 06:23:49 http: TLS handshake error from 121.10.68.93:15909: EOF

wz7465 commented on 7 Feb

不是,应该是被干扰了
如果网站不支持http2,goproxy会自动降级到http1.1连接

kang000feng commented on 8 Feb

感谢社长, 我博客已经撸了篇详尽的安装及使用教程了 @wpyok500 可以自己申请一个

lovehahhah commented on 8 Feb

Owner

phuslu commented on 9 Feb

改了改代码,也能用容器部署了。

跑在容器云的时候主要解决的问题,是需要提供一个外部的包含证书的外部 toml 问题。

用法例子可见 https://hub.docker.com/r/phuslu/goproxy-vps/

Owner

phuslu commented on 9 Feb • edited

在樱花主机上部署了一个 https://c1.phus.lu:XXXXX/ 没有 auth, 可供大家测试。

容器云有个不好的地方,就是端口都是它随机指定的,这个比较郁闷,将就用下吧。

晚上删除此回复。

gxggsrmyy commented on 9 Feb

@phuslu 怎样部署在别的端口,443端口已占用

Owner

phuslu commented on 9 Feb

不建议部署到其他端口。goproxy-vps 可以和 nginx 共用端口的。https://www.fanyueciyuan.info/fq/goproxy-vps-443.html

wangyi2005 commented on 9 Feb

不能利用 arukas Endpoint 现成的证书吗?而且Endpoint 是固定的。

Owner

phuslu commented on 9 Feb

不能,它的 endpoint 是有一层负载均衡,会挡掉 http proxy 请求。

wz7465 commented on 9 Feb

你给的新版测试和我在同一平台上使用的老版,速度还是明显被限制死了
111

Owner

phuslu commented on 9 Feb

@wz7465 比较奇怪,我尝试复现一下。

wz7465 commented on 9 Feb

我xp,火狐都可以用,不存在这个问题

Contributor

MeABc commented on 9 Feb

Firefox 51 开启 TLS 1.3 支持

about:config

security.tls.version.max 把 3 改成 4

图示:

default

Firefox Nightly 默认已支持 TLS 1.3

wz7465 commented on 9 Feb

我用的3,可以用,改成4后,速度反而更慢

Contributor

MeABc commented on 9 Feb

firefox 51 用 3 那是 tls 1.2 ,改成 4 后才是 tls 1.3 。

速度反而更慢 ----但是这不应该啊。

wz7465 commented on 9 Feb

@MeABc 理论上当然如此,但是tls 1.3的使用是以google为代表的率先使用,国内还没有铺开,如果广泛使用了,gfw理论上也不能这样限制了,否则误伤面太大了

Owner

phuslu commented on 9 Feb

我和身边相当一部分的用户在打开 tls 1.3 的确会有肉眼可见级别的改善。

所以 @wz7456 的情况的确比较奇怪,目前暂时只能用所在运营商干扰来解释。

wz7465 commented on 9 Feb

我用vpn前置的方法试过了,突破了速度限制,速度冲上去过,但是使用了一段时间,整个线路被限制了,速度又降下来

Contributor

MeABc commented on 9 Feb • edited

就像社长说的,TLS 1.3 所带来的改善是可以明显感觉到的。

另,大家可以测试下这个网站。它已持 TLS1.3 。(可通过修改浏览器配置)

https://ssldecoder.org/

可以感觉到在 TLS1.3 下打开网页明显的快。

default

wz7465 commented on 9 Feb

我现在这个时段好像没干扰了,只是单纯的限速在2m,打开网页响应很快

wangyi2005 commented on 9 Feb

@phuslu arukas Endpoint 会转发到容器的监听端口的啊。

wz7465 commented on 9 Feb

同一台主机,把http2降级使用,速度立马上去了,只有等http2普及了
111

wz7465 commented on 9 Feb

大概放水,ip也满血了
222

wz7465 commented on 10 Feb

用社长的镜像修改了一下,还是搞了一个自签发证书,100年有效期,部署在樱花平台上好用了。
配置proxy_auth_method = "pam"不删除的话,有报错goproxy-vps.go:700] pam: exec.LookPath("python") error: exec: "python": executable file not found in $PATH,好像需要python更新

Owner

phuslu commented on 10 Feb

在 docker 里面运行 goproxy-vps 因为权限关系导致不能使用 PAM 认证。

我会加一个认证方法,暂定叫 "internal", 就是把用户名和密码写在 toml 配置文件的形式。

wz7465 commented on 10 Feb

我在本地也建了一个,不出国,访问国内网站,速度是刷刷的
111

dapao9999 commented on 10 Feb

配置文件里有个proxy_fallback,这个是有什么用?

Owner

phuslu commented on 10 Feb

为了让 443 端口物尽其用。在处理非代理请求的时候,提供转发到本机的某个端口(一般是 nginx 80 端口)的机制。

https://www.fanyueciyuan.info/fq/goproxy-vps-443.html

dapao9999 commented on 10 Feb

新版不能指定证书了吗,我在一个NAT小鸡上跑,因为没有443端口,会报错
2017-02-10_114845.png

Owner

phuslu commented on 10 Feb

可以,参见这个配置 https://pastebin.com/raw/QUPuM4L6

haike80 commented on 11 Feb

干货,明珠。可是我是纯野人。anyway,恭喜社长新玩具出炉。

Contributor

MeABc commented on 12 Feb

纠正一下我上面 #1470 (comment) 这里面说到的

https://ssldecoder.org/ 支持TLS 1.3 目前来看有错误。

原因:我发现 ssldecoder.org 前端使用了 cloudflare CDN,即,现在可以确定的是 cloudflare CDN 支持了 TLS 1.3,而 ssldecoder.org 网站本身是否支持 TLS 1.3 还未知。

特此纠正。

Owner

phuslu commented on 12 Feb

是的。 cloudflare 开源的它家 tls 1.3 实现

https://github.com/cloudflare/tls-tris/commits/master

我移植到了 phuslu/go 这个 repo,所以 才有了goproxy-vps 的 tls 1.3 的支持。

基于 OpenSSL 的 tls 1.3 的实现由 akamai 捐赠,计划会在 4 月份的 1.1.1 版本中发布。

预计届时 nginx nghttp2 nghttpx 也会加入 tls 1.3 的支持。

Contributor

MeABc commented on 12 Feb

tls 1.3 现在各家支持也是很快啊!

Owner

phuslu commented on 12 Feb • edited

OpenSSL 选择在 1.1.x 版本加入 tls1.3 是个很赞的决定(应该是akamai有意为之)

如果强行在 1.2.x 加入会有 ABI 兼容性问题,主流linux发行版不会很快升级。

现在这样搞法,不但 c 系的服务器软件,各个脚本语言 node python 也会很快得到 tls1.3 的支持。

一句话总结:准备迎接 TLS 1.3 吧。:trollface:

Owner

phuslu commented on 12 Feb

又改了改,加上了 tls 的客户端证书验证功能,可以用来对抗 TLS 探针。

不过客户端证书验证用起来的确不如 PAM 这种友好易用。。。

SeaHOH commented on 12 Feb

微信好像也在应用 TLS 1.3。

LinkDo2 commented on 23 Feb

请问这个是什么错误啊

2017/02/23 00:32:31 http: TLS handshake error from x.x.x.x:xx: read tcp x.x.x.x:xx->x.x.x.x:xx: read: connection reset by peer
2017/02/23 00:32:31 http: TLS handshake error from x.x.x.x:xx: read tcp x.x.x.x:xx->x.x.x.x:xx: read: connection reset by peer
2017/02/23 00:32:32 http: TLS handshake error from x.x.x.x:xx: read tcp x.x.x.x:xx->x.x.x.x:xx: read: connection reset by peer
2017/02/23 00:32:32 http: TLS handshake error from x.x.x.x:xx: read tcp x.x.x.x:xx->x.x.x.x:xx: read: connection reset by peer
2017/02/23 00:32:33 http: TLS handshake error from x.x.x.x:xx: read tcp x.x.x.x:xx->x.x.x.x:xx: read: connection reset by peer
2017/02/23 00:32:34 http: TLS handshake error from x.x.x.x:xx: read tcp x.x.x.x:xx->x.x.x.x:xx: read: connection reset by peer
2017/02/23 00:32:35 http: TLS handshake error from x.x.x.x:xx: tls: oversized record received with length 20037
2017/02/23 00:32:35 http: TLS handshake error from x.x.x.x:xx: tls: oversized record received with length 20037
2017/02/23 00:32:36 http: TLS handshake error from x.x.x.x:xx: tls: oversized record received with length 20037
2017/02/23 00:32:36 http: TLS handshake error from x.x.x.x:xx: tls: oversized record received with length 20037
2017/02/23 00:32:37 http: TLS handshake error from x.x.x.x:xx: read tcp x.x.x.x:xx->x.x.x.x:xx: read: connection reset by peer

gagqgs commented on 4 Mar

用一键脚本,显示:Cannot detect goproxy-vps_linux_amd64 version

kirbyzhu commented on 4 Mar

mark一下

jaoyina commented on 8 Mar

谁给个完整安装文档,谢谢。

wjm2038 commented on 9 Mar

`[root@3ory3ugqjh ~]# curl -L git.io/get-goproxy-vps | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 3396 100 3396 0 0 6889 0 --:--:-- --:--:-- --:--:-- 6889
0. Local Goproxy VPS version

  1. Checking GoProxy VPS Version
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    100 87951 0 87951 0 0 192k 0 --:--:-- --:--:-- --:--:-- 192k
  2. Downloading goproxy-vps_linux_amd64-r167.tar.xz
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    100 9 0 9 0 0 31 0 --:--:-- --:--:-- --:--:-- 31
  3. Extracting goproxy-vps_linux_amd64-r167.tar.xz
    xz: goproxy-vps_linux_amd64-r167.tar.xz: File format not recognized`

请问如何解决呢

dapao9999 commented on 12 Mar

reject_nil_sni = false
parent_proxy = "https://example.org"
这两个参数是干什么的啊?

Owner

phuslu commented on 13 Mar • edited

reject_nil_sni = false

拒绝 SNI 为空的 https 连接,可以防止被访问的目标网站通过 IP 反查证书和网站。

parent_proxy = "https://example.org"

支持 upstream 代理,可以完成一些有趣的功能。

[http]
parent_proxy = "https://bwg.phus.lu"

就是一个所谓的 "客户端了"

Owner

phuslu commented on 16 Mar

Firefox 已经支持 tls1.3 的 0-RTT 的连接了
见 https://blog.cloudflare.com/introducing-0-rtt/

Enter about:config in the address bar
Ensure security.tls.version.max is 4 (this enables TLS 1.3)
Set security.tls.enable_0rtt_data to true

@phuslu phuslu changed the title from goproxy-vps r143 已经是一个成熟可用的 tls1.3 + http2 代理了。 to goproxy-vps r168 已经是一个成熟可用的 tls1.3 + http2 代理了。 on 16 Mar

Owner

phuslu commented on 19 Mar

r172 以后加入类似 nginx 的 ecc/rsa 双证书功能,能够根据客户端类型自动选择使用 ECC 还是 RSA 证书(优先 ECC).

提高了兼容性。

kid424 commented on 31 Mar

firefox成功,chrome失败,懵逼中……

mikelei8291 commented on 6 Apr

如何通过源码编译?不知道需要哪些依赖包
现在 https://github.com/phuslu/goproxy-ci/releases 里编译好的 goproxy-vps 不能用 htpasswd 验证只能自己编译了。。

Owner

phuslu commented on 6 Apr

@mikelei8291 可以试下 #1510

不过我自测 htpasswd 的认证方式倒是可以的。。。

mikelei8291 commented on 6 Apr

@phuslu 感谢,我试试用这个编译
之前我是直接运行最上面发布的安装命令安装的,下载的是 r177 的版本,配置文件里的验证方式改成 proxy_auth_method = "htpasswd" 以后运行,log 里显示 unsupport proxy_auth_method(htpasswd)

mikelei8291 commented on 6 Apr

@phuslu 编译失败
报错:

_/root/github/goproxy_builder/goproxy-server.vps-linux-amd64
# _/root/github/goproxy_builder/goproxy-server.vps-linux-amd64./goproxy-vps.go:646:29: undefined: tls.VersionTLS13
./goproxy-vps.go:649:18: unknown field 'Max0RTTDataSize' in struct literal of type tls.Config
./goproxy-vps.go:650:17: unknown field 'Accept0RTTData' in struct literal of type tls.Config
./goproxy-vps.go:651:20: unknown field 'AllowShortHeaders' in struct literal of type tls.Config
make[2]: *** [goproxy-vps] Error 2
make[2]: Leaving directory `/root/github/goproxy_builder/goproxy-server.vps-linux-amd64'
make[1]: *** [goproxy-common-build] Error 2
make[1]: Leaving directory `/root/github/goproxy_builder'
make: *** [server.vps] Error 2

mikelei8291 commented on 6 Apr

@phuslu 一小时前 release 的 r183 已经能使用 htpasswd 验证了,感谢

dapao9999 commented on 7 Apr

http2模式下貌似被限速到1m左右的速度?在手机上用https模式不限速

dapao9999 commented on 7 Apr

确实是http2模式被限速了,同一网络同一vps下,开bbr,电脑只有1m

Owner

phuslu commented on 7 Apr • edited

@dapao9999

goproxy-vps r189 加入一个新的配置 [[https]] 见

goproxy/goproxy-vps.toml

Lines 12 to 16 in 5835d79

[[https]]
listen = ":443"
server_name = ["proxy.example.org"]
proxy_fallback = "file:///var/www/html"
proxy_auth_method = "pam"

[[https]]
listen = ":443"
server_name = ["proxy.example.org"]
proxy_fallback = "file:///var/www/html"

这样在服务端就能禁用 http2 防止限速了

Owner

phuslu commented on 8 Apr • edited

r191 发布了。

  1. 提高了 htpasswd 认证的效率
  2. 加了一个新的配置 [[sniproxy]], 用来减少 https/http2 -> https/http2 这种 proxy chains 的开销。
[[sniproxy]]
server_name = ["proxy.example.org"]
host = "proxy-end.example.org"
port = 443

这种方式的话,就是 tcp 透传,而省去 tls 的二次转发的开销。

注意,一般需要 "proxy-end.example.org" 这台机器上的 goproxy-vps 配置 wildcard (野卡)证书。否则需要手动拷贝 proxy.example.org 证书到这台机器上。

zzuzjl commented on 9 Apr

请问安卓手机上使用什么软件啊

Owner

phuslu commented on 9 Apr

@zzuzjl 安卓可以用 drony, 不过这个软件设置比较繁琐,不如 iOS 上的 wingy 和 surge

hunter-xue commented on 12 Apr

北京联通,只有50k左右。使用chrome。

@pexcn pexcn referenced this issue in shadowsocks/shadowsocks-libev on 13 Apr

Closed

请问 ss 支持这些特性吗? #1444

haike80 commented on 15 Apr

鼎力支持。看来我离买vps很近了。

Owner

phuslu commented on 26 Apr

goproxy-vps r198 的客户端模式已经支持 tls1.3 了。
示例配置如下。

[http]
listen = ":8080"
parent_proxy = "https://<user>:<pass>@<your_goproxy_vps>"

coeusite commented on 27 Apr

建议更新一下 Docker Image

Owner

phuslu commented on 27 Apr

啊忘了,已更新。刚在 GCE 加了一个定时任务,以后每天 4:00 更新 Docker Image.

coeusite commented on 27 Apr • edited

自用的 systemd service 文件,仅供参考

tee /etc/systemd/system/goproxy.service <<-'EOF'
[Unit]
Description=GoProxy Server Service by phuslu@github
After=network.target

[Service]
Type=simple
WorkingDirectory=/opt/goproxy/
ExecStart=/opt/goproxy/goproxy-vps

[Install]
WantedBy=multi-user.target
EOF

但是这么做申请letsencrypt证书的时候会出错(missing certificate)……
首先运行一遍./goproxy-vps.sh start生成证书后错误消失,但总觉得证书到期不能auto renew。


另外,proxy_fallback = "https://www.bing.com"也会出错,显示
<h2>Our services aren't available right now</h2><p>We're working to restore all services as soon as possible. Please check back soon.</p>
但是使用 proxy_fallback = "http://127.0.0.1:80" 则一切正常。


同 VPS 分别部署了 GOPROXY 和 SSR,测速(speedof.me)时的差别颇大,
前者下载/上传/延迟分别为 840 kbps / 370 kbps / 373 ms,后者 7680 kbps / 1110 kbps / 1114 ms。


Firefox 认 LE 的证书,会显示 Valid Certificate,不需要额外导入证书。
只不过 FoxyProxy 会弹出来问是否添加例外。

ShureCool commented on 30 Apr

搬瓦工使用命令部署不了,是因为vps的配置太低了吗?

[root@xue-vps ~]# curl -L git.io/get-goproxy-vps | bash % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 102 3473 102 3473 0 0 4476 0 --:--:-- --:--:-- --:--:-- 44760. Local Goproxy VPS version1. Checking GoProxy VPS Version % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 100 89061 0 89061 0 0 196k 0 --:--:-- --:--:-- --:--:-- 296k2. Downloading goproxy-vps_linux_amd64-r198.tar.xz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 101 611 0 611 0 0 2023 0 --:--:-- --:--:-- --:--:-- 492 3 2141k 3 86586 0 0 88601 0 0:00:24 --:--:-- 0:00:24 8860100 2141k 100 2141k 0 0 1373k 0 0:00:01 0:00:01 --:--:-- 3539k3. Extracting goproxy-vps_linux_amd64-r198.tar.xzxz: goproxy-vps_linux_amd64-r198.tar.xz: Memory usage limit reachedxz: Limit was 28 MiB, but 65 MiB would have been needed

wz7465 commented on 30 Apr

解压需要的内存不够,可以尝试在别的机器上先解压,然后拷贝文件夹,goproxy本身使用的内存不多

kirbyzhu commented on 1 May

另外freenom使用gae可以访问但是不能登录 使用php以前可以访问登录后出错 现在访问都访问不了了
想搞个二级域名搞不定

kirbyzhu commented on 1 May • edited

另外按照 @breakwa11 的部署方法部署了ssr 和 按照社长的 mixool/gost 镜像部署的gost服务器端
都能在arukas里面运行但是客户端都访问不了 真是古了怪了

提示都是:
未连接到互联网 代理服务器出现问题或地址有误

mixool commented on 1 May

mixool/gost是小白我写的,不是社长。设置cmd: -L=:443 chrome就可以用了。
社长的这个在vps上面搭建很方便,docker不知道怎么用。
你仔细按着步骤看,一定哪里疏忽了。

kirbyzhu commented on 1 May

kirbyzhu commented on 1 May

@mixool 完全照抄https://mixool.blogspot.ca/ 上面的设置

结果无法启动
image

mixool commented on 1 May

这里还是讨论goproxy吧,我和朋友测试都能用的,或者你可以试试mixool/alpine-gost

kirbyzhu commented on 1 May

@mixool 好吧 那我再找地方测试一下

coeusite commented on 10 May

请问已经支持“客户端证书验证”了么?
扫了一眼代码,只看到了 pam htpasswd builtin

tiany520 commented on 24 May

F0523 16:54:00.598584 2811 goproxy-vps.go:1044] Listen(:443) error: listen tcp :443: bind: address already in use
很莫名其妙 我以为是系统问题 又把VPS还原了 再配置来安装 还是显示这个错误 查看了端口占用 也就是 goproxy-vps 进程用了 443 端口

直接https://我的域名 访问失败 确认了是端口并未打开
后来改端口到 8080 还是访问不了
@phuslu

coeusite commented on 24 May

好像目前还不支持证书鉴权?

kirbyzhu commented on 24 May

证书是可以的 pem写在环境变量导入文件中

Owner

phuslu commented on 24 May

@coeusite 实现的了 https://github.com/phuslu/goproxy/blob/server.vps/goproxy-vps.go#L799-L800

配置大致如下

[[http2]]
client_auth_file = "/path/to/client_ca_file"

或

[[http2]]
client_auth_pem = """
<把 client ca pem 文件复制在此>
"""

hcym commented on 27 May

老大
这个vps部署谷歌云行不行
ss是可以的

kirbyzhu commented on 10 Jun

@hcym google VM 部署可以的 很方便 https和http2速度差不多

hcym commented on 10 Jun

@kirbyzhu
部署过,不能用,没有提示
是不是要绑定个域名签个证书啊
其他步骤都是按照规矩来的
呵呵哈哈,现在道路太多,有点萌圈

kirbyzhu commented on 10 Jun • edited

使用前面 @coeusite 提供的speedof.me 测试了一下
同样部署了ssr和goproxy-vps的谷歌VM,下载速度相差10倍还多。上传速度基本一致。
我感觉是因为ssr的客户端可以同时并发10个连接。不过我goproxy-vps是用了stunnel作为客户端,也并发了10多个连接。

所以具体原因就不知道了,但是胜在稳定。

kirbyzhu commented on 10 Jun

@hcym 必须绑定域名。我用了443端口,据说可以自签证书的,但是保险起见,我还是在配置文件里面用pem设置了证书。

证书很方便。前面有人提示过。或者用openssl自签san证书,或者用acme.sh生成证书。
最方便的是,如果你的域名准备的是 aaa.bbb.com 那么开goproxy客户端登录一下 https://aaa.bbb.com 然后在goproxy客户端ecc目录下就会有证书 .bbb.com.crt存在,用noteplus++之类的打开就是可用的ecc证书,由goproxy签发,3年有效期。把这里面的信息写到服务器端的 goproxy-vps.toml里面就可以了。

hcym commented on 10 Jun

绑定域名
试试看
谢谢kirbyzhu

THLIVSQAZ commented on 11 Jul

做一个简易安装手册
1.vps 自行选择购买,不做推荐,建议内存不要太低(256mb,解压都成问题)
2.申请域名,很多选择,.tk,.ml等是免费域名
3.dns解析(可选,适合国外申请的域名,加快解析速度),可选cloudxn,dnspod等
4.安装goproxy-vps,可以用curl -L git.io/get-goproxy-vps | bash,输入域名即可,不过配置没有https选项,需要自行添加
推荐是用wget https://github.com/phuslu/goproxy-ci/releases/download/r1474/goproxy-vps_linux_amd64-rxxx.tar.xz (xxx为版本号),然后tar -xJvf goproxy-vps_linux_amd64-rxxx.tar.gz ( 解压失败看看是不是xz-utils没装)
5.(上面用第一条命令的,跳过此步)把goproxy-vps.toml 中example.org 和proxy.example.org换成你的域名(一样的),把http的选项去掉
6.验证问题,听说pam不太听话,可能和系统有关吧,自测没问题,root是不能验证的,用adduser添加用户。也可以使用其他验证htpasswd(自行google,不难使用),client ca pem(比较复杂,适合对签发证书比较了解者)
6.启动 前端:在goproxy-vps目录执行./goproxy-vps 后台:./goproxy-vps.sh start 抓日志cat goproxy-vps.log
7.客户端
chrome://flags/#ssl-version-max 的 tls1.3 支持 搭SwitchyOmega 选择https类型,填上域名,端口443
stunnel 跨平台软件
drony(安卓)
goproxy-vps(推荐,因为一些软件不支持tls1.3,会出现403错误)
把配置文件的http选项留下,其余选项删除,parent_proxy中的example.org换成你的域名,如有pam、htpasswd验证,格式为https://用户名:密码@域名,如有端口重定向,则https://用户名:密码@域名: 端口
8. 祝gp爱好者使用愉快,感谢社长

Owner

phuslu commented on 28 Jul • edited

r243 版本加入 quic 支持。

服务端升级到 r243 自动打开。
客户端做如下配置

[http]
listen = ":8000"
parent_proxy = "quic://yourdomain.com"

效率不错,自我感觉相对于 ss + kcptun 有优势。

gagqgs commented on 29 Jul

版本递进的好快!想了解下goproxy-vps 的更新策略,是建议求新,更新最新的版本,还是有稳定版,无需追版本号?

coeusite commented on 31 Jul • edited

使用 QUIC 后无法连接,改回 HTTPS 后一切正常
链路为 Chrome -> gop r245(client) =(quic w/ pam)=> gop r245(server/443) => any web
server 侧 UDP 入站端口已开,不确定 client 侧是否限制非标准端口的出站 UDP 链接

其中

  • Chrome 报错 ERR_TUNNEL_CONNECTION_FAILED
  • gop(local)无报错,显示http.go:92] 127.0.0.1:55900 "CONNECT play.google.com:443 HTTP/1.1" - -
  • gop(server)未显示log

Update: 我的情况和 @wz7465 不太一样,我这边使用 Chrome / Firefox 访问 http 页面时出现:
proxy: failed to read greeting from HTTP proxy at MYDOMAIN.COM:443: 407 Proxy Authentication Required

难道是走 QUIC 不接受 user:pass@domain 式的鉴权请求?


扫了一眼代码,好象客户端要使用https+h2才能强制走HTTP/2,即
parent_proxy = "https+h2://yourdomain.com"

wz7465 commented on 31 Jul

访问http网站报错:read udp: Proof Invalid
访问https网站报错:ERR_TUNNEL_CONNECTION_FAILED
我在内网测的,排除了udp被墙干扰的可能性
社长说他测试正常,我怀疑环境不同,他可能用的开发环境

wz7465 commented on 1 Aug

@coeusite 域名没有正确解析,就会报错这条信息
我的报proxy: failed to read greeting from HTTP proxy at example.org:443: 400 Bad Request
你的加了认证,所以报407

@THLIVSQAZ 按照你的简单安装手册搞定了
选择验证的时候选择了没验证的最简单安装,想请教一下如果要安装htpasswd做验证大概要怎么操作呢?
现在搭的貌似是个公开的https的代理,想给加个需要验证,不然不敢装在自己的vps用呀

luckypoem commented on 6 Aug

@THLIVSQAZ ,我自己买了证书,应该怎么设置?

luckypoem commented on 7 Aug

@phuslu
我自己买了证书,应该怎么设置?可以回复一下吗?
非常感谢

luckypoem commented on 7 Aug

可否给出详细的配置文件,都搞糊涂了

qazesz1 commented on 7 Aug • edited

[[http2]]
listen = ":443"
server_name = ["000"]
#proxy_fallback = "http://127.0.0.1:80"
proxy_auth_method = "pam"

[[https]] 
listen = ":444" 
server_name = ["000"] 
#proxy_fallback = "http://127.0.0.1:80" 
proxy_auth_method = "pam" 

我的配置是这样的,为什么通过444端口访问我的域名的时候仍然采用的http/2?
如果把http2的内容全部注释掉,这时444端口才不使用http/2。
我从chrome://net-internals/#http2这里看的。

@liyangyijie liyangyijie referenced this issue in fanyueciyuan/eazy-for-ss on 7 Aug

Closed

请教goproxy-vps/自己证书的问题 #19

luckypoem commented on 8 Aug

摸索了一下,终于搞定。
wget https://github.com/phuslu/goproxy-ci/releases/download/r1533/goproxy-vps_linux_amd64-r248.tar.xz
tar Jxvf goproxy-vps_linux_amd64-r248.tar.xz
cd goproxy-vps

root@gcv:~/goproxy-vps# ls
goproxy-vps goproxy-vps.sh pwauth
get-latest-goproxy-vps.sh goproxy-vps.toml README.md

root@gcv:~/goproxy-vps# nano goproxy-vps.toml
修改goproxy-vps.toml为如下形式:
[default]
log_level = 2
reject_nil_sni = false
daemon_stderr = "./goproxy-vps.log"

[[http2]]
listen = ":8443"
server_name = ["mydomain.com"]
proxy_fallback = "http://127.0.0.1:80"
pem = """
-----BEGIN RSA PRIVATE KEY-----
...............................
-----END RSA PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
...........................
-----END CERTIFICATE-----
"""
root@gcv:~/goproxy-vps# ./goproxy-vps > /dev/null &
这样,服务器端就运行好了。

然后在客户机上,安装chrome,并安装chrome的插件switchyomega
(https://chrome.google.com/webstore/detail/proxy-switchyomega/padekgcemlokbadohgkifijomclgjgif)
安装chrome的插件switchyomega后,点击chrome的右上角的switchyomega图标,然后点击“选项”-“新建情景模式”-“情景模式名称”取名为goproxy-vps proxy(名称可以随便取)-点击“创建”- “代理协议”选择https,"代理服务器"栏填写你所绑定的域名mydomain.com,“代理端口”填写8443-点击“应用选项”。
然后在chrome中,即可翻墙。
建议去注册一个top域名,很便宜,才2usd/年;证书的话,可到这里https://cheapsslsecurity.com/sslproducts/domainvalidatedssl.html,购买一个Comodo PositiveSSL证书,8usd/年。把生成的私匙内容复制粘贴在pem = """的下一行处,把证书服务商发给你的证书内容复制粘贴在
-----END RSA PRIVATE KEY----- 这一行的下一行处。然后记得在粘贴的证书内容的下一行写上:"""
教程完毕,祝翻墙愉快。

自签证书应该也是ok的,我没试过。

luckypoem commented on 9 Aug

我测试过:自签证书不行。若用自签证书,chrome里会显示:err:proxy_certificate_invalid.

kirbyzhu commented on 10 Aug

@luckypoem 自签证书是可以的 chrome里面导入自签证书就行

@kirbyzhu 谢谢提示,找时间试一下

Let’s Encrypt配置SSL证书以及自动续期的方法-Certbot

本文推荐的方式,应该是目前最简单的方式了!

Let’s Encrypt应该一款免费开源的SSL生成程序。操作相对比较容易,使用门槛不高。
网上有很多Let’s Encrypt部署方法,有兴趣可以去Google一下。
本文介绍用Certbot来生成ssl证书

官网
https://certbot.eff.org/
https://github.com/certbot/certbot

部署
本文演示以Centos为例!官方提供多种系统的配置说明,可以自行查阅。

安装certbot:
wget https://dl.eff.org/certbot-auto
chmod 755 certbot-auto
./certbot-auto

解析域名
生成证书前,需要将域名全部解析到服务器上,否则生成失败。

生成域名证书

下面的代码是生成 yourdomain.com / www.yourdomain.com / api.yourdomain.com

如果你要生成更多域名,直接后面再加 -d xxxxx.xx 即可啦。
./certbot-auto certonly --standalone -d yourdomain.com -d www.yourdomain.com -d api.yourdomain.com

命令执行过程中,
需要填写你的邮箱 ,输入邮箱回车。
同意TOS条款 ,输入 Y 表示同意,回车。
还有一个同意分享邮箱,输入Y 回车。

生成成功,可到目录 /etc/letsencrypt/live/ 查看我们的证书了!最后显示:
...

  • Congratulations! Your certificate and chain have been saved at:
    /etc/letsencrypt/live/yourdomain.com/fullchain.pem
    Your key file has been saved at:
    /etc/letsencrypt/live/yourdomain.com/privkey.pem
    Your cert will expire on 2017-11-08. To obtain a new or tweaked
    version of this certificate in the future, simply run certbot-auto
    again. To non-interactively renew all of your certificates, run
    "certbot-auto renew"
  • If you like Certbot, please consider supporting our work by:
    Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
    Donating to EFF: https://eff.org/donate-le
    root@default:~# cd /etc/letsencrypt/live/yourdomain.com/
    root@default:/etc/letsencrypt/live/yourdomain.com# ls
    README cert.pem chain.pem fullchain.pem privkey.pem
    root@default:/etc/letsencrypt/live/yourdomain.com#

cert.pem和privkey.pem就是我们需要的东西。

自动续期
首先我们需要将可执行文件 移动一个公共目录。
如果要放到root目录下,只要处理好权限问题也是可以的。

手动延期
./certbot-auto renew --dry-run

利用Cron自动延期
注意路径问题:
./certbot-auto renew --quiet

很不错,我用此法也用上了Let’s Encrypt的免费证书。而用acme.sh的方法,未搞定。

@kirbyzhu ,我在mac下测试了。打开“keychain access",并且点开了左上角的钥匙,但仍然无法点击左下角的“+”号,为什么?

kirbyzhu commented 29 days ago

@luckypoem 没能理解你的问题诶

kirbyzhu commented 29 days ago

最好用的自签证书是goproxy自动生成的网站证书 cache目录的ecc文件夹里面 不需要再导入

在 windows下,是可以导入证书的,但是mac不行,估计是因为mac的机制更严。

@phuslu
你好!
我觉得最早的那个vps_linux_amd64.tar.bz2
(https://github.com/phuslu/goproxy/releases/download/goproxy/vps_linux_amd64.tar.bz2)
最好用,最适合初学者。既不需要域名,也不需要证书,也不需要安装switchy-omega.
phuslu ,你可否重新上传这个vps_linux_amd64.tar.bz2以及32位版到你的github账号呢?
殷切期待中。。。
非常非常感谢你。

Owner

phuslu commented 27 days ago

@briteming

之前所谓好用是因为自动生成了自签证书,这个实在不是一个好的方案。
现在我还是建议申请域名并且绑定 443 端口(这样就可以自动签署合法的 letsencrpt 证书了,无需配置了)

写了个教程,请看下
https://ws1.sinaimg.cn/large/87023b2cgy1fiifq4y2ujj20my0izgm4.jpg

coeusite commented 24 days ago • edited

突然想起个问题,client 会验证 server 的证书么? 毕竟受到 MitM 攻击的风险还是存在的

另外,比如我的VPS的域名是 example.org,IP是 4.3.2.1:8765
但我访问的时候希望通过一个 haproxy relay,所以访问的时候使用 1.2.3.4:5678
这个时候可以手动设置域名为 example.org 么?

Owner

phuslu commented 24 days ago

chrome 使用的话会验证的。goproxy-vps 的客户端模式还没有验证,我尽快加上。

briteming commented 21 days ago • edited

@phuslu ,事实上,我有vps_linux_amd64.tar.bz2的32位版,但是没有vps_linux_amd64.tar.bz2,
please,please,上传vps_linux_amd64.tar.bz2吧。本来翻墙就是要便于用户使用,对吗?更何况还有那么多小白呢。
这个既不需要操心域名,也不需要操心证书,也不需要安装switchy-omega的工具实在太有存在价值了。
还请phuslu再三考虑考虑。我替小白用户们谢谢你

终于找到一个类似最早版本的版本:https://github.com/phuslu/goproxy-ci/releases/download/r1001/goproxy-vps_linux_amd64-r54.tar.bz2

非常感谢phuslu开发出这样简单省事给力的翻#墙软件,phuslu真是功德无量。保重你自己,keep anonymous!

dou4cc commented 20 days ago

@briteming phuslu不是匿名的,2010年毕业于南大

@dou4cc
这位兄弟赶快删掉你的评论,我们要保护作者的匿名性

pexcn commented 15 days ago

@phuslu 请问 reject_nil_sni 这个选项是干什么用的?

Owner

phuslu commented 15 days ago

@pexcn 如果客户端 tls 握手没有 sni 信息的话,就关闭连接。设置为 true 的话,一定程度上可以防止 gfw 的 tls 探针。

pexcn commented 15 days ago

@phuslu 嗯,谢谢大佬解释。我还有和问题:#1952 这个,我测试了最新版,仍然是ipv6 first...

@phuslu
最近买了个 nat vps,vps 商家并未开放 443 端口给用户使用,那么要具体怎样设置,才能在自己的 nat vps 上,用上 443 端口?
我用的是这个版本https://github.com/phuslu/goproxy-ci/releases/download/r1001/goproxy-vps_linux_amd64-r54.tar.bz2

coeusite commented 3 days ago

更新新版 FoxyProxy 后无法使用,用 Firefox 的同学请勿更新。

gop 版本 r257
更新add-on后,访问网页会先提示输入帐号密码,然后显示“Secure Connection Failed”错误
在服务端修改reject_nil_sni并不能解决问题。

ufo86817 commented 2 days ago

VPS 使用 SSL证书登录 已关闭密码登录功能
PAM验证是否就不能用了?打不开任何网页
htpasswd文件用了各种方法都无效,也是打不开任何网页
客户端证书验证又是怎么实现呢

proxy_auth_method 前面加#注释掉 才能正常上G Y T F 等

mixool commented 4 hours ago • edited

使用脚本安装的,服务端用的默认设置
客户端配置

[http]
listen = ":8000"
parent_proxy = "https+h2://ex.xxx"

速度有4000Kbps
而使用

[http]
listen = ":8000"
parent_proxy = "quic://ex.xxx"

速度就只有400Kbps。
社长说的quic相对于ss+kcptun优势在哪,是不是我姿势不对。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment