Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用cloudflare加速时,直连域名可以,CDN域名不行 #245

Open
galaxy001 opened this issue Jun 10, 2019 · 15 comments
Open

使用cloudflare加速时,直连域名可以,CDN域名不行 #245

galaxy001 opened this issue Jun 10, 2019 · 15 comments

Comments

@galaxy001
Copy link

galaxy001 commented Jun 10, 2019

{
    "server":"0.0.0.0",
    "server_port":2095,
    "local_port":1080,
    "password":"PASSWORD",
    "timeout":60,
    "method":"chacha20-ietf-poly1305",
    "mode":"tcp_and_udp",
    "fast_open":true,
    "plugin":"obfs-server",
    "plugin_opts":"obfs=http;failover=www.cloudflare.com:80;fast-open"
}

{
    "server":"0.0.0.0",
    "server_port":2096,
    "local_port":1080,
    "password":"PASSWORD",
    "timeout":60,
    "method":"chacha20-ietf-poly1305",
    "mode":"tcp_and_udp",
    "fast_open":true,
    "plugin":"obfs-server",
    "plugin_opts":"obfs=tls;failover=www.cloudflare.com:443;fast-open"
}

用VPS的ip,或者cf的直连域名,可以使用。
但换成cdn域名,就不能使用了。Surge测试时,http模式能返回延迟,tls模式直接失败。
但cdn域名直接访问时,failover可以正常加载。

是不是需要在cloudflare里面调整压缩加速的选项?我是用免费版的cf,希望能问下该怎么设置cf。

@chenlola
Copy link

chenlola commented Jul 2, 2019

我自己的一些小经验,可以参考

使用cloudflare时,obfs使用 http 不要使用 tls,CDN 的https会做一层tls封装,可能导致客户端解密失败。

Server

{
"server":"0.0.0.0",
"server_port":2095,
"local_port":1080,
"password":"PASSWORD",
"timeout":60,
"method":"chacha20-ietf-poly1305",
"mode":"tcp_and_udp",
"fast_open":true,
"plugin":"obfs-server",
"plugin_opts":"obfs=http ;failover=www.cloudflare.com:80;fast-open"
}
{
"server":"0.0.0.0",
"server_port":2096,
"local_port":1080,
"password":"PASSWORD",
"timeout":60,
"method":"chacha20-ietf-poly1305",
"mode":"tcp_and_udp",
"fast_open":true,
"plugin":"obfs-server",
"plugin_opts":"obfs=http ;failover=www.cloudflare.com:443;fast-open"
}

Client

plugin : obfs-server
plugin_opts : obfs=http;obfs-host=your.cloudflare.domain

(Change "your.cloudflare.domain" to your actual binding domain.)

@xianren78
Copy link

xianren78 commented Aug 19, 2019

补充一下,CDN在安卓上要想成功使用,要用随附链接里面的20190820版。(https://github.com/xianren78/simple-obfs-android/releases)
再补充一下:1,支持自定义CF IP来连接。
2,NGINX或者caddy反代,只支持http,不支持443https端口。实际上simple-obfs都不支持真正的https
PS: 感谢@xiuluo,提供travis自动发布的方法,让我也可以在线编译并发布到github; 踩了一个大坑,注册的travis-ci.com,生成secure的时候用的是org, 一遍一遍的401 - Bad credentials // See: https://developer.github.com/v3 (Octokit::Unauthorized)。
QQ截图20190925110752
QQ截图20190925110942
QQ截图20190925111042

@xiuluo
Copy link

xiuluo commented Aug 20, 2019

@xianren78 然而我现在用的是v2ray (逃

@xianren78
Copy link

@xianren78 然而我现在用的是v2ray (逃

学习知识为主,我也早就v2ray了

@chor
Copy link

chor commented Oct 25, 2019

我的也用不了,浏览器访问域名正常。客户端通过域名连接不行,通过ip连接是可以的。求教
{
"server":["[::0]","0.0.0.0"],
"server_port":8210,
"local_port":1080,
"password":"pwd",
"timeout":60,
"mode":"tcp_and_udp",
"fast_open":true,
"method":"aes-256-gcm",
"plugin":"/usr/local/bin/obfs-server",
"plugin_opts":"obfs=http;failover=127.0.0.1:80;fast-open"
}

@xianren78
Copy link

我的也用不了,浏览器访问域名正常。客户端通过域名连接不行,通过ip连接是可以的。求教
{
"server":["[::0]","0.0.0.0"],
"server_port":8210,
"local_port":1080,
"password":"pwd",
"timeout":60,
"mode":"tcp_and_udp",
"fast_open":true,
"method":"aes-256-gcm",
"plugin":"/usr/local/bin/obfs-server",
"plugin_opts":"obfs=http;failover=127.0.0.1:80;fast-open"
}

HTTP ports supported by Cloudflare:

80
8080
8880
2052
2082
2086
2095

另外请注意客户端兼容性问题

@chor
Copy link

chor commented Oct 25, 2019

@xianren78 我用80端口的

@xianren78
Copy link

@xianren78 我用80端口的

把CF 客户端和服务端的配置都截图贴出来吧,你贴的配置端口是8210啊,你客户端用什么?

@chor
Copy link

chor commented Oct 25, 2019

我的也用不了,浏览器访问域名正常。客户端通过域名连接不行,通过ip连接是可以的。求教
{
"server":["[::0]","0.0.0.0"],
"server_port":8210,
"local_port":1080,
"password":"pwd",
"timeout":60,
"mode":"tcp_and_udp",
"fast_open":true,
"method":"aes-256-gcm",
"plugin":"/usr/local/bin/obfs-server",
"plugin_opts":"obfs=http;failover=127.0.0.1:80;fast-open"
}

HTTP ports supported by Cloudflare:

80
8080
8880
2052
2082
2086
2095

另外请注意客户端兼容性问题

{
"server": ["0.0.0.0"],
"server_port":8880,
"password":"pwd",
"timeout":60,
"mode": "tcp_only",
"no_delay":true,
"method":"aes-256-gcm",
"plugin":"/usr/bin/v2ray-plugin",
"plugin_opts":"server;fast-open;host=domain.com;loglevel=none"
}
同一个域名,v2ray-plugin with websocket是可以的。

@chor
Copy link

chor commented Oct 25, 2019

@xianren78 我用80端口的

把CF 客户端和服务端的配置都截图贴出来吧,你贴的配置端口是8210啊,你客户端用什么?

{
"server":["[::0]","0.0.0.0"],
"server_port":80,
"local_port":1080,
"password":"pwd",
"timeout":60,
"mode":"tcp_and_udp",
"fast_open":true,
"method":"aes-256-gcm",
"plugin":"/usr/local/bin/obfs-server",
"plugin_opts":"obfs=http;failover=127.0.0.1:8080;fast-open"
}
这个是现时obfs配置

@chor
Copy link

chor commented Oct 25, 2019

@xianren78 我用80端口的

把CF 客户端和服务端的配置都截图贴出来吧,你贴的配置端口是8210啊,你客户端用什么?

image

@xianren78
Copy link

xianren78 commented Oct 25, 2019

@xianren78 我用80端口的

把CF 客户端和服务端的配置都截图贴出来吧,你贴的配置端口是8210啊,你客户端用什么?

1,插件程序填obfs-local可以吗?我填的obfs-local.exe,我手边没有电脑测试不了。
2,把服务端的fastopen去掉
3,看一下你的obfs-server和obfs-local.exe版本号是不是最新的。

@chor
Copy link

chor commented Oct 25, 2019

@xianren78 我用80端口的

把CF 客户端和服务端的配置都截图贴出来吧,你贴的配置端口是8210啊,你客户端用什么?

1,插件程序填obfs-local可以吗?我填的obfs-local.exe,我手边没有电脑测试不了。
2,把服务端的fastopen去掉
3,看一下你的obfs-server和obfs-local.exe版本号是不是最新的。

把客户端的服务器地址从域名改成ip是可以用的

@Martinho0330
Copy link

@xianren78 我用80端口的

把CF 客户端和服务端的配置都截图贴出来吧,你贴的配置端口是8210啊,你客户端用什么?

1,插件程序填obfs-local可以吗?我填的obfs-local.exe,我手边没有电脑测试不了。 2,把服务端的fastopen去掉 3,看一下你的obfs-server和obfs-local.exe版本号是不是最新的。

server配置
{
"server":["0.0.0.0"],
"mode":"tcp_and_udp",
"server_port": 2086,
"password": "pwd",
"timeout":60,
"fast_open":true,
"method":"chacha20-ietf-poly1305",
"plugin":"obfs-server",
"plugin_opts":"obfs=http"
}

server 本地直接起ss-local
ss-local -k=pwd -s cf.domain -p 2086 -l 1080 -mchacha20-ietf-poly1305 --plugin obfs-local --plugin-opts=obfs=http;obfs-host=cf.domain

server 直接指向ss-local
ALL_PROXY=socks5h://127.0.0.1:1080 curl https://google.com/ -v

Rebuilt URL to: https://google.com/
Trying 127.0.0.1...
TCP_NODELAY set
SOCKS5 communication to google.com:443
SOCKS5 request granted.
Connected to 127.0.0.1 (127.0.0.1) port 1080 (#0)
ALPN, offering h2
ALPN, offering http/1.1
successfully set certificate verify locations:
CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
TLSv1.3 (OUT), TLS handshake, Client hello (1):
仍然不行

@arieslee
Copy link

@xianren78 然而我现在用的是v2ray (逃

我也想用v2ray ,奈何手机上的APP不支持v2ray 这种插件,只有OBFS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants