A https based cors anywhere selfhost code.
More infomation please read the origin project cors-anywhere README.
First apply for a certificate use acme.sh. It will generate several files, we only use YOUR.DOMAIN.com.key
and fullchain.cer
.
Second put the js file in your server.
Finally, run it.
nohup node cors-anywhere-selfhost.js &
Normally it will automatically renew. If there is no automatic renewal, use the following command:
~/.acme.sh/acme.sh --force --issue --dns dns_cf -d YOUR.DOMAIN.com
Ref: