{"id":13616827,"url":"https://github.com/lesuixin/v2ray-cf","last_synced_at":"2025-04-14T03:31:43.756Z","repository":{"id":113596978,"uuid":"333339933","full_name":"lesuixin/v2ray-cf","owner":"lesuixin","description":"v2ray套CF无域名加速的小白教程","archived":false,"fork":false,"pushed_at":"2022-05-15T07:49:07.000Z","size":12,"stargazers_count":29,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-08T01:37:40.691Z","etag":null,"topics":["cloudflare","cloudflare-worker","cloudflare-workers","v2ray"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lesuixin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-01-27T07:33:42.000Z","updated_at":"2024-08-01T18:46:04.000Z","dependencies_parsed_at":"2023-05-24T04:15:47.364Z","dependency_job_id":null,"html_url":"https://github.com/lesuixin/v2ray-cf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesuixin%2Fv2ray-cf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesuixin%2Fv2ray-cf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesuixin%2Fv2ray-cf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesuixin%2Fv2ray-cf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lesuixin","download_url":"https://codeload.github.com/lesuixin/v2ray-cf/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248815578,"owners_count":21165950,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudflare","cloudflare-worker","cloudflare-workers","v2ray"],"created_at":"2024-08-01T20:01:33.791Z","updated_at":"2025-04-14T03:31:38.745Z","avatar_url":"https://github.com/lesuixin.png","language":null,"funding_links":[],"categories":["Others"],"sub_categories":[],"readme":"# v2ray-cf  \n# v2ray套CF无域名加速的小白教程  \n### 参考资料：  \n#### llmwxt的[小白教程]CF Workers实现直接套CF加速。https://www.hostloc.com/thread-781847-1-1.html\n#### CCChieh的IBMYes教程。https://github.com/CCChieh/IBMYes\n\n### 第一步：v2ray脚本，端口80的websocket，不要TLS。不能用随机端口。  \n### 第二步：在Cloudflare中找到Workers（登录后首页右边），取名.workers.dev之后就创建Worker，左边脚本全选改为Josephus的不要证书，没域名代码。  \n```\naddEventListener(\n  'fetch',event =\u003e {\n     let url=new URL(event.request.url);\n     url.hostname='111.111.111.111.nip.io';\n     if(url.protocol == 'https:') {\n        url.protocol='http:'\n     }\n     let request=new Request(url,event.request);\n     if(request.headers.has(\"Origin\")) {\n       request.headers.delete(\"Origin\");\n     }\n     event.respondWith(\n          fetch(request)\n    )\n  }\n)\n```\n修改url.hostname后面的ip为服务器的地址，.nip.io要留着，那个是一个公共项目，可以把ip转成域名。  \n.xip.io不能访问，修改为.nip.io，备用sslip.io  \n\n#### 点击中间HTTP下面GET右边按钮send发送，测试几次是否出现400 Bad Request，出现则成功，点击保存并部署（不能是502 Bad Gateway或是其它）（用原先不用.nip.io的会出现502）  \n![image1](https://github.com/ccchieh/IBMYes/raw/master/img/README/image-20200615214543839.png)  \n代码不同，右边相同  \n\n### 第三步：客户端地址换为改名.取名.workers.dev，用工具找CF自选ip，看IBMYes教程的设置，客户端把地址换成自选ip，伪装域名换成cloudflare的workers的域名。  \n![去v2的客户端中修改地址](https://github.com/ccchieh/IBMYes/blob/master/img/README/image-20200615215120033.png)  \n现在已经使用了cloudflare的代理  \n在客户端把地址换成ip，伪装域名换成我们cloudflare的workers的域名即可  \n![image](https://github.com/ccchieh/IBMYes/blob/master/img/README/image-20200615215820188.png)\n\n### 来自suixin from suixin\n### 2021-5-1 xip.io失效，重写 修改为.nip.io，备用sslip.io\n#### 疑问：没有域名可以开TLS吗？（有TLS的用随机端口，可以443）\n\n#### 2022-5-15 更新\n## Cloudflare无域名加速失效\n### workers.dev被全面dns污染，被sni阻断，无法直连*.workers.dev\n\n#### 需要改用Workers自定义域名  \n进入DNS选项，解析CNAME你的域名到Workers，打开小云朵  \n配置Workers路由  \n添加路由，域名要填：你的域名/*  \n\n想要自选 IP，那么只需要在添加子域名记录的时候，不开启代理（橙色 ☁），直接指向自选 IP 即可。  \n\n原IBMYes的Workers代码\n```\naddEventListener(\n\"fetch\",event =\u003e {\nlet url=new URL(event.request.url);\nurl.hostname=\"cf.cloud\";\nlet request=new Request(url,event.request);\nevent. respondWith(\nfetch(request)\n)\n}\n)\n```\n修改第四行为你的域名\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flesuixin%2Fv2ray-cf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flesuixin%2Fv2ray-cf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flesuixin%2Fv2ray-cf/lists"}