在 https://workers.cloudflare.com 新建一个workers,将 workers.js
的内容复制粘贴就完成了
- 可以设置环境变量或者取消注释设置
ORIGIN
- 可以设置环境变量或者取消注释设置
AllowedReferrer
- 可以设置
$origin
/index.html
是演示站 https://bduss.nest.moe 的源码,要直接使用需要修改或删除下述几项
L108
及L109
Google analytics 相关L115
api地址
仅限 PHP 版有要求,workers 版直接部署
php 7.x
php-curl
- 请将回调链接进行
base64
编码后以hash
形式添加到连接到网站的链接中 - 默认不提供
stoken
,如果需要请在query
的stoken_type
中体现,至于这个stoken_type
的可用值请自行寻找
参考格式
//https://bduss.nest.moe/#/aHR0cHM6Ly9leGFtcGxlLmNvbS8/c3Rva2VuX3R5cGU9dGI=
"https://bduss.nest.moe/#/" + btoa("https://example.com/?stoken_type=tb")//这样会回调会带贴吧的stoken
//---
"https://bduss.nest.moe/#/" + btoa("https://example.com/")//这样会不带stoken
关于 Google analytics 可以参考 SukkaW/cloudflare-workers-async-google-analytics
关于本项目原理可以参考 扫码登录百度获取BDUSS