mirror of
https://github.com/movie-web/docs.git
synced 2025-09-13 10:23:26 +00:00
Port all documents to MDX
This commit is contained in:
31
pages/proxy/changelog.mdx
Normal file
31
pages/proxy/changelog.mdx
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
title: 'Changelog'
|
||||
---
|
||||
|
||||
# Version 2.1.3
|
||||
- Upgrade nitro, which fixes issues on AWS lambda
|
||||
|
||||
# Version 2.1.2
|
||||
- Block more headers, be more anonymous (only works on non-cloudflare platforms)
|
||||
- Add package version to route `/` for debugging purposes
|
||||
- Add REQ_DEBUG=true variable to allow for logging all requests made.
|
||||
- Remove old console.log
|
||||
|
||||
# Version 2.1.1
|
||||
- Fix support for JWT on non-Cloudflare platforms
|
||||
- Fix header copying logic so User-Agent, Referer and Origin work properly
|
||||
- Upgrade h3
|
||||
|
||||
# Version 2.1.0
|
||||
|
||||
- [Added Turnstile integration](2.configuration.md#turnstile_secret) to secure your workers from abuse.
|
||||
|
||||
# Version 2.0.1
|
||||
|
||||
- Bugfix where sometimes body would double read
|
||||
- Bugfix where sometimes no response would be given at all due to race condition
|
||||
|
||||
# Version 2.0.0
|
||||
|
||||
- Full rewrite, now supports multiple platforms: nodejs, Cloudflare, AWS lambda
|
||||
- Standard proxy headers are no longer sent through. Which now doesn't send a client ip through anymore.
|
26
pages/proxy/configuration.mdx
Normal file
26
pages/proxy/configuration.mdx
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
title: 'Configuration'
|
||||
---
|
||||
|
||||
# Proxy Config Reference
|
||||
|
||||
Adding environment variables is different for every platform, [here's a guide on how to add environment variables on Cloudflare](https://developers.cloudflare.com/workers/configuration/environment-variables/#add-environment-variables-via-the-dashboard){target="\_blank"}. You'll have to do some research on your own if you aren't hosting the proxy on Cloudflare.
|
||||
|
||||
# Reference
|
||||
|
||||
### `TURNSTILE_SECRET`
|
||||
|
||||
- Type: `string`
|
||||
- Default: `""`
|
||||
|
||||
Turnstile secret key from the [Cloudflare dashboard](https://dash.cloudflare.com/sign-up?to=/:account/turnstile){target="\_blank"}.
|
||||
::alert{type="warning"}
|
||||
Keep in mind that you will also need to [configure the Turnstile key on the client](../3.client/3.configuration.md#vite_turnstile_key) and **configure the [`JWT_SECRET`](#jwt_secret) below.**
|
||||
::
|
||||
|
||||
### `JWT_SECRET`
|
||||
|
||||
- Type: `string`
|
||||
- Default: `""`
|
||||
|
||||
A [JWT](https://jwt.io/) secret key. This can be any random secret, but **must be 32 characters long.**
|
104
pages/proxy/deploy.mdx
Normal file
104
pages/proxy/deploy.mdx
Normal file
@@ -0,0 +1,104 @@
|
||||
---
|
||||
title: 'Deploy'
|
||||
---
|
||||
|
||||
# Deploying the proxy
|
||||
|
||||
## Method 1 - Netlify (Easy)
|
||||
|
||||
Netlify has a very generous free plan, so you'll be able to host your proxy for free unless you get hundreds of users.
|
||||
|
||||
[](https://app.netlify.com/start/deploy?repository=https://github.com/movie-web/simple-proxy){target="\_blank"}
|
||||
|
||||
1. Create a GitHub account at https://github.com/signup if you don't have one already.
|
||||
1. Click on the `Deploy to Netlify` button above.
|
||||
1. Authorize Netlify to connect with GitHub by clicking the `Connect to GitHub` button.
|
||||
1. There should now be a `Save & Deploy` button, click it.
|
||||
1. Once the deployment is complete, click on the `Get Started` button that pops up, this will redirect you to the dashboard of your site.
|
||||
1. Click on the only site in the `Sites` section of your dashboard.
|
||||
1. Find the link of your site near the top of the page, it should look something like `https://<random-words>.netlify.app`. Right click the link, click `Copy link address`. [Now you'll just have to set up the client](../5.extra/1.streaming.md#method-1---self-hosted-proxy)!
|
||||
|
||||
## Method 2 - Cloudflare (Easy)
|
||||
|
||||
::alert{type="warning"}
|
||||
The sources showbox and febbox do NOT work with cloudflare. Use a different host if you want those to work.
|
||||
::
|
||||
|
||||
Cloudflare has a generous free plan, so you don't need to pay anything unless you get hundreds of users.
|
||||
|
||||
[](https://deploy.workers.cloudflare.com/?url=https://github.com/movie-web/simple-proxy){target="\_blank"}
|
||||
|
||||
1. Create a GitHub account at https://github.com if you don't have one.
|
||||
1. Click the `Deploy with workers` button above.
|
||||
1. Click the `Authorize Workers` button to authorize Cloudflare to talk to GitHub.
|
||||
1. Authorize Cloudflare Workers in the GitHub page that pops up.
|
||||
1. Follow the instructions to configure your Cloudflare account. Select `I have an account` if you have a Cloudflare account already, otherwise follow the link to create one.
|
||||
1. Click the link to [`Workers Dashboard`](https://dash.cloudflare.com/sign-up?to=/:account/workers-and-pages){target="\_blank"} to find your account ID.
|
||||
1. You can copy your account ID from the URL e.g. https://dash.cloudflare.com/ab7cb454c93987b6343350d4e84c16c7/workers-and-pages/create where `ab7cb454c93987b6343350d4e84c16c7` is the account ID.
|
||||
1. Paste the account ID into the text box on the original Cloudflare workers page.
|
||||
1. Click the link to [`My Profile`](https://dash.cloudflare.com/profile/api-tokens){target="\_blank"}, to create an API token.
|
||||
1. Click `Create Token`.
|
||||
1. Select `Use template` next to `Edit Cloudflare Workers`.
|
||||
1. Under `Account Resources`, select `Include` and your account under the dropdown.
|
||||
1. Under `Zone Resources`, select `All zones` (You can select a more specific zone if you have the zones available).
|
||||
1. At the bottom of the page, click `Continue to summary`.
|
||||
1. On the next screen, click `Create token`.
|
||||
1. Copy the API token and **save it in a safe place, it won't be shown again**.
|
||||
1. Paste the API token into the Cloudflare Workers API Token text box.
|
||||
1. Click `Fork the Repository` and follow the instructions to enable workflows.
|
||||
1. Click `Deploy` to deploy to Cloudflare Workers.
|
||||
1. Congratulations! Your worker is now deploying. Please wait for the GitHub Action to build and publish your worker.
|
||||
1. You can click the [`Worker dash`](https://dash.cloudflare.com/sign-up?to=/:account/workers-and-pages){target="\_blank"} and `GitHub repo` buttons to see the status of the deploy.
|
||||
1. When the worker has deployed, you will need to take note of the URL. This can be found on Cloudflare under [Workers and Pages -> Overview](https://dash.cloudflare.com/sign-up?to=/:account/workers-and-pages){target="\_blank"} -> Proxy.
|
||||
1. Use the URL you took note of and [set up a custom proxy in the client](../5.extra/1.streaming.md#method-1---self-hosted-proxy).
|
||||
|
||||
## Method 2 - Cloudflare (Manual)
|
||||
|
||||
::alert{type="warning"}
|
||||
The sources showbox and febbox do NOT work with cloudflare. Use a different host if you want those to work.
|
||||
::
|
||||
|
||||
1. Login to your Cloudflare account if you have one, otherwise create one [here](https://dash.cloudflare.com/sign-up?to=/:account/workers-and-pages)
|
||||
1. If you are signing up for an account, make sure to verify your email before going further!
|
||||
1. Download the latest version of the Cloudflare [`simple-proxy-cloudflare.mjs` script from here](https://github.com/movie-web/simple-proxy/releases/latest/download/simple-proxy-cloudflare.mjs).
|
||||
1. Go to `Workers & Pages` and then `Overview` in the left-hand navigation bar.
|
||||
1. Click the `Create Worker` button
|
||||
1. If you've made a worker or pages application before, you will need to click `Create Application` first
|
||||
1. Give your worker a name and click `Deploy`. This can be anything you would like!
|
||||
1. On the `Congratulations` web page, click the `Edit code` button to edit the code in the worker you have just created.
|
||||
1. There should now be a code editor on the left hand side on the web page.
|
||||
1. Select all of the existing template code and delete it. **You must make sure all of the code is deleted for this to work!**
|
||||
1. Go to your downloads folder and open up the `simple-proxy-cloudflare.mjs` file you downloaded earlier in a text editor, and **copy** the contents.
|
||||
1. Back in your browser, paste the contents of the file into the code editor.
|
||||
1. The `Save and deploy` button in the top right corner should now be active, click it to deploy your proxy!
|
||||
1. A confirmation dialog will appear, click `Save and deploy` once more.
|
||||
1. Your worker is now deployed! You can click the back button in the top left to take you back to the summary screen.
|
||||
1. On the summary screen, your worker link will be displayed under `Preview`. Right click the link, click `Copy link address` and save the link somewhere - [you will need it to set up the client](../5.extra/1.streaming.md#method-1---self-hosted-proxy)!
|
||||
|
||||
## Method 3 - Railway (Easy)
|
||||
|
||||
Railway offers you $5 of credit once you verify your account, which is enough to run the proxy for around 5-7 months.
|
||||
|
||||
[](https://railway.app/template/dyYHq1)
|
||||
|
||||
1. Login to your [Railway](https://railway.app) account if you have one, otherwise create one [here](https://railway.app/login).
|
||||
1. If you are signing up, then verify your account by clicking the link in the email Railway sends you.
|
||||
1. If you created your account with an email, then to verify your account further, go to your account, then plans and verify your account with a GitHub account.
|
||||
1. Click the [`Deploy on Railway`](https://railway.app/template/dyYHq1) button above.
|
||||
1. If a `Configure` button is displayed, click on it and allow Railway to access your GitHub account.
|
||||
1. The `Deploy` button at the bottom of the template should be active, click on it.
|
||||
1. Once the proxy has deployed, copy the URL from the `Deployments` page.
|
||||
1. Congratulations! You have deployed the proxy, [you can now set up the client](../5.extra/1.streaming.md#method-1---self-hosted-proxy).
|
||||
|
||||
## Method 4 - Docker
|
||||
|
||||
::alert{type="warning"}
|
||||
Experience with Docker, domains and web hosting is **highly recommended** for this method. <br />
|
||||
[Deploying with Netlify](#method-1-netlify-easy) is easier and safer to do! You are exposing your server at your own risk!
|
||||
::
|
||||
|
||||
Our `simple-proxy` application is available from the GitHub Container Registry under the image [`ghcr.io/movie-web/simple-proxy:latest`](https://ghcr.io/movie-web/simple-proxy:latest){target="\_blank"} :copy-button{content="ghcr.io/movie-web/simple-proxy:latest"}
|
||||
|
||||
The container exposes the HTTP port (Without TLS/SSL) as `3000/TCP`.
|
||||
|
||||
If you know what you are doing, you should know what to do with this information. If you don't, then please follow our Cloudflare guides.
|
11
pages/proxy/introduction.mdx
Normal file
11
pages/proxy/introduction.mdx
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
title: 'Introduction'
|
||||
---
|
||||
|
||||
# Introduction to the proxy
|
||||
|
||||
Our proxy is used to bypass CORS-protected URLs on the client side, allowing users to make requests to CORS protected endpoints without a backend server.
|
||||
|
||||
The proxy is made using [Nitro by UnJS](https://nitro.unjs.io/) which supports building the proxy to work on multiple providers including Cloudflare Workers, AWS Lambda and [more...](https://nitro.unjs.io/deploy)
|
||||
|
||||
Our recommended provider is Netlify due to its [generous free plan](https://www.netlify.com/pricing/#core-pricing-table).
|
Reference in New Issue
Block a user