JAVClub / proxy

Proxies for core and web

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

想請教一下關於proxy的配置細節

yuanqiuye opened this issue · comments

将 ./workers/dist/main.js 的内容部署至 Workers 即可

但執行node main.js的時候卻跑出以下東西:

TypeError: Cannot read property 'aesPassword' of null

也許是我眼殘,又或是我真的跟Node不熟 QQ
可以請教以下作者標準步驟為何嗎?

P.S:
如果採用原方案在vercel上面架proxy,是要整個repo deploy上去嗎?
我也稍微嘗試了以下,得不出所以然 (我就菜QQ)

可能是原文没写清楚, 应该补一句话: 以下 Workers 所指的均为 Cloudflare Workers

以及感觉你没看懂文档, 你的情况的话前四行应该长这样 (文档中提到的将第三行第一个注释删掉)
并且请记得填写 ./workers/config.js

const CryptoJS = require('crypto-js')
const Base64 = require('js-base64').Base64
const oAuth = {} || require('./config') // Needed if not using vercel
const aesPassword = oAuth.aesPassword || require('./../vercel/config').password

headers['authorization'] = 'Bearer ' + ((!oAuth && accessToken) || await this.accessToken())

在這一行中的判定,若oAuth = {},且accessToken !== {},而且沒有自定義workers/config.js
則會((!oAuth && accessToken) || await this.accessToken()) == undefined的情形,如圖 ( !{} == false ):
github

我的错我的错 当时脑子估计有点昏 (
这几天抽空重写一遍吧

Fixed in 51ae0aa

This issue is closed due to not being active. Please feel free to open it again or create a new one and reference this if you have further questions.