This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Website you intended to retrieve for users. | |
const upstream = 'api.openai.com' | |
// Custom pathname for the upstream website. | |
const upstream_path = '/' | |
// Website you intended to retrieve for users using mobile devices. | |
const upstream_mobile = upstream | |
// Countries and regions where you wish to suspend your service. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// RSA with node-forge | |
"use strict"; | |
// npm install node-forge | |
const forge = require("node-forge"); | |
new Promise((f, r) => forge.pki.rsa.generateKeyPair( | |
2048, (err, pair) => err ? r(err) : f(pair))) | |
.then(keypair => { | |
const priv = keypair.privateKey; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
import simplejson as json | |
except ImportError: | |
import json | |
from django.views import generic | |
from django.http import HttpResponse | |
class JsonView(generic.View): | |
""" |