This is a Next.js project bootstrapped with create-next-app.
Its purpose is to test proxy support using Node.js environment variables.
Follow the following steps to set up and run the app:
-
Generate an
AUTH_SECRETRunnpx auth secretAuth.js requires anAUTH_SECRETenvironment variable. This is a random string used to encrypt tokens and email verification hashes. -
Configure GitHub OAuth Credentials Create a GitHub OAuth application:
- Go to GitHub → Settings → Developer settings → OAuth Apps.
- Click New OAuth App and fill in the required fields.
- Get your Client ID and Client Secret.
For more detailed instructions check out: https://authjs.dev/guides/configuring-github
-
After completing the steps above, your
.env.localfile should look like:AUTH_SECRET={AUTH_SECRET} AUTH_GITHUB_ID={CLIENT_ID} AUTH_GITHUB_SECRET={CLIENT_SECRET}
-
Start the Proxy Server You can use the provided
proxyserver.jsor substitute it with your own proxy server. -
Run the development server with NODE_USE_ENV_PROXY set to 1, along with HTTP_PROXY / HTTPS_PROXY environment variables:
Example, for this app with proxy server
proxyserver.js:NODE_USE_ENV_PROXY=1 \ HTTP_PROXY=http://127.0.0.1:8000 \ npm run dev
-
You should now see all requests to
api.github.comlogged by the proxy server.