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/openAI/v2ex #123

Open
bamboodew opened this issue Feb 24, 2024 · 6 comments
Open

无法访问cloudflare/openAI/v2ex #123

bamboodew opened this issue Feb 24, 2024 · 6 comments

Comments

@bamboodew
Copy link

bamboodew commented Feb 24, 2024

image
延迟OK
测速报错:The SSL connection could not be established, see inner exception.

开启代理后:
可以访问Google、YouTube,速度还可以
image

但无法访问cloudflare、openAI、v2ex

image

@bamboodew bamboodew changed the title cloudflare无法访问 无法访问cloudflare/openAI/v2ex Feb 24, 2024
@kerry64
Copy link

kerry64 commented Feb 26, 2024

把代码里的proxyIP 改成一个对任意cloudflare IP(访问提示DirectIP access not allowed,1.1.1.1不行,随便ping一个就行)的转发。可以自建、找中转ip或者其他公共服务都可以

@ablebodied
Copy link

把代码里的proxyIP 改成一个对任意cloudflare IP(访问提示DirectIP access not allowed,1.1.1.1不行,随便ping一个就行)的转发。可以自建、找中转ip或者其他公共服务都可以

@kerry64 有没有详细的说明如何操作呢?能有原理说明就更好了,谢谢了

@kerry64
Copy link

kerry64 commented Feb 29, 2024

把代码里的proxyIP 改成一个对任意cloudflare IP(访问提示DirectIP access not allowed,1.1.1.1不行,随便ping一个就行)的转发。可以自建、找中转ip或者其他公共服务都可以

@kerry64 有没有详细的说明如何操作呢?能有原理说明就更好了,谢谢了
改这个

const proxyIPs = ['cdn.xn--b6gac.eu.org', 'cdn-all.xn--b6gac.eu.org', 'workers.bestip.one'];
这个Array里有三个,可以多加几个。具体找的地方是TG里有CF中转IP分享。还有一些靠谱的公共服务(甚至作者留了注释)。另外proxyIP选择是根据一个随机数的,如果你为了稳定,就只留一个,或者把随机的地方改成固定。

原理是retry函数里
const tcpSocket = await connectAndWrite(proxyIP || addressRemote, portRemote)
当connect到addressRemote这个地址时失败了,由于CF的网络很强,假设他如果能连上,就肯定能连上,那么原因就是,要么是这个地址服务已经访问不了了,要么是这个地址在cloudflare的IP段(cf的connect暂时关闭了对自家ip段的访问)。所以把这个地址换成一个对CF的IP的转发,因为CF是anycast,只要是转发到他家地址就没问题。

这个转发的服务器可以用haproxy实现。

@ablebodied
Copy link

把代码里的proxyIP 改成一个对任意cloudflare IP(访问提示DirectIP access not allowed,1.1.1.1不行,随便ping一个就行)的转发。可以自建、找中转ip或者其他公共服务都可以

@kerry64 有没有详细的说明如何操作呢?能有原理说明就更好了,谢谢了

改这个

`const proxyIPs = ['cdn.xn--b6gac.eu.org', 'cdn-all.xn--b6gac.eu.org', 'workers.bestip.one'];

`

这个Array里有三个,可以多加几个。具体找的地方是TG里有CF中转IP分享。还有一些靠谱的公共服务(甚至作者留了注释)。另外proxyIP选择是根据一个随机数的,如果你为了稳定,就只留一个,或者把随机的地方改成固定。

原理是retry函数里

const tcpSocket = await connectAndWrite(proxyIP || addressRemote, portRemote)

当connect到addressRemote这个地址时失败了,由于CF的网络很强,假设他如果能连上,就肯定能连上,那么原因就是,要么是这个地址服务已经访问不了了,要么是这个地址在cloudflare的IP段(cf的connect暂时关闭了对自家ip段的访问)。所以把这个地址换成一个对CF的IP的转发,因为CF是anycast,只要是转发到他家地址就没问题。

这个转发的服务器可以用haproxy实现。

@kerry64 为什么必须要加一个这个代理IP呢?为什么不能是 客户端然后到cf workers然后到被墙的网站呢?

@kerry64
Copy link

kerry64 commented Feb 29, 2024

他本来就是客户端-worker-目标网站。但cf worker限制了对cf ip range的访问。代码里写了,先尝试直接访问目标网站,如果通了,那就通。没通才会用proxyip retry

@stupidloud
Copy link

stupidloud commented Mar 4, 2024

他本来就是客户端-worker-目标网站。但cf worker限制了对cf ip range的访问。代码里写了,先尝试直接访问目标网站,如果通了,那就通。没通才会用proxyip retry

可是workers既然闲置了ip range,为什么给proxy设置cf的ip又可以连接上? @kerry64

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

4 participants