disqusjs-proxy
disqusjs-proxy copied to clipboard
Disqus API Proxy in Node.js
disqusjs-proxy
一个使用 Node.js 编写的 Disqus API Proxy 的示例。
本地运行
npm install
npm start
部署到 Heroku
或
heroku create
git push heroku master
heroku open
自定义
自定义参数在 config.json 文件中。
refererHost: 检查请求来源 (Referer) 的主机名。
该选项会检查请求头中的Referer可以阻止他人使用你的代理。
可以是单个域名"disqus.example.com"也可以是域名数组["test.example.com", "disqus.example.com"]。
设为false可禁用检查。开启该选项后若检查不通过会返回 404,不返回 403 是因为这么做可以让 Firebase 缓存该结果。 开启后无法直接在地址栏中访问,因为直接访问时浏览器不会发送
Referer。resHeaders: 添加或修改响应头,可以设置Cache-Control让 Firebase 缓存反代的结果。proxyOpt: 传递给 http-proxy-middleware 的选项。pathRewrite: 设置子目录重写。默认的子目录是/disqus/,如果你想修改,需要同时修改config.json和firebase.json。