From 9c21c48e32528d6dc0527ac6d92bc77830ca88cd Mon Sep 17 00:00:00 2001
From: Pas <74743263+Pasithea0@users.noreply.github.com>
Date: Thu, 15 May 2025 16:51:12 -0600
Subject: [PATCH] Add m3u8 docs
---
pages/client/configuration.mdx | 23 +++++++-
pages/proxy/deploy.mdx | 103 +++++++++++++--------------------
pages/proxy/introduction.mdx | 11 +++-
3 files changed, 71 insertions(+), 66 deletions(-)
diff --git a/pages/client/configuration.mdx b/pages/client/configuration.mdx
index f3edf7a..127b569 100644
--- a/pages/client/configuration.mdx
+++ b/pages/client/configuration.mdx
@@ -29,7 +29,8 @@ window.__CONFIG__ = {
};
```
-## Config Reference - Shared Config
+## Required Config Reference:
+---
### `VITE_TMDB_READ_API_KEY` ⚠
@@ -59,6 +60,26 @@ You can add multiple Workers by separating them with a comma, they will be load
**Required. The client will not work properly if this is not configured.**
+### `VITE_M3U8_PROXY_URL`
+
+- Type: `string`
+- Default: `""`
+- Example: `"https://example1.example.com,https://example2.example.com"`
+
+**The same proxy as above**, but used to proxy streams. However, it **must** be hosted on a server that is NOT blocked by FlixHQ. See this [explainer](../proxy/introduction.mdx).
+
+If left empty, some streams, notibly streams from FlixHQ, WILL NOT work.
+
+You can add multiple Workers by separating them with a comma, they will be load balanced using round robin method on the client.
+**Worker URL entries must not end with a slash.**
+
+
+ **Required. The client will not work properly if this is not configured.**
+
+
+## Optional Config Reference:
+---
+
### `VITE_DMCA_EMAIL`
- Type: `string`
diff --git a/pages/proxy/deploy.mdx b/pages/proxy/deploy.mdx
index b77fa61..e784ace 100644
--- a/pages/proxy/deploy.mdx
+++ b/pages/proxy/deploy.mdx
@@ -4,7 +4,18 @@ title: 'Deploy'
# Deploying the proxy
-## Method 1 - Netlify (Easy)
+
+
+**Selfhosting the client as well?**
+
+Please read [THIS](./introduction.mdx) and use Method 4 (Docker) or Method 5 (Manual)!
+
+Cloudflare and Netlify's IPs are blocked by FlixHQ and the proxy MUST be hosted on a VPS or other server.
+
+
+
+
+## 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.
@@ -120,68 +131,6 @@ Cloudflare has a generous free plan, so you don't need to pay anything unless yo
-## Method 2 - Cloudflare (Manual)
-
-
-
- Login to your Cloudflare account if you have one, otherwise create one
- [here](https://dash.cloudflare.com/sign-up?to=/:account/workers-and-pages) -
- If you are signing up for an account, make sure to verify your email before
- going further!
-
-
-
- Download the latest version of the Cloudflare [`sudo-proxy-cloudflare.mjs`
- script from
- here](https://github.com/p-stream/simple-proxy/releases/download/v2.1.5/simple-proxy-cloudflare.mjs).
-
-
-
- Go to `Workers & Pages` and then `Overview` in the left-hand navigation bar.
-
-
-
- Click the `Create Worker` button - If you've made a worker or pages
- application before, you will need to click `Create Application` first - Give
- your worker a name and click `Deploy`. This can be anything you would like!
-
-
-
- On the `Congratulations` web page, click the `Edit code` button to edit the
- code in the worker you have just created.
-
-
-
- There should now be a code editor on the left hand side on the web page. -
- Select all of the existing template code and delete it. **You must make sure
- all of the code is deleted for this to work!** - Go to your downloads folder
- and open up the `sudo-proxy-cloudflare.mjs` file you downloaded earlier in a
- text editor, and **copy** the contents. - Back in your browser, paste the
- contents of the file into the code editor.
-
-
-
- The `Save and deploy` button in the top right corner should now be active,
- click it to deploy your proxy!
-
-
-
- A confirmation dialog will appear, click `Save and deploy` once more.
-
-
-
- Your worker is now deployed! You can click the back button in the top left
- to take you back to the summary screen.
-
-
-
- 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.
@@ -223,6 +172,7 @@ Railway offers you $5 of credit once you verify your account, which is enough to
## Method 4 - Docker
+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.
Experience with Docker, domains and web hosting is **highly recommended** for
@@ -236,4 +186,31 @@ P-Stream does not have a Docker image for the proxy yet. You can create one your
The container exposes the HTTP port (Without TLS/SSL) as `3000/TCP`.
+## Method 5 - Manual
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.
+
+Manually installing the proxy on your server. You may want to use an automated package manager like nixpacks to do this.
+
+
+
+ Clone the repo on your server `git clone https://github.com/p-stream/simple-proxy`
+
+
+
+ Navigate to the directory `cd simple-proxy`
+
+
+
+ Install packages `pnpm i`
+
+
+
+ Build the app `pnpm build`
+
+
+
+ Start the proxy `pnpm start`
+
+
+
+You'll need to configure port forwarding and firewall settings. Good luck.
\ No newline at end of file
diff --git a/pages/proxy/introduction.mdx b/pages/proxy/introduction.mdx
index 75c303b..7616fe6 100644
--- a/pages/proxy/introduction.mdx
+++ b/pages/proxy/introduction.mdx
@@ -4,8 +4,15 @@ 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 has **two** functions and is **required** to self host the project entirely.
+
+No. 2 only applies if you are also deploying the **client**.
+
+
+1. The 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).
+2. For site admins (self hosters), the proxy is also used to bypass m3u8 stream header restrictions for sites such as FlixHQ. Because of this active restriction, this proxy needs to be hosted on a VPS, platform, or home server that's IP is **NOT** blocked by FlixHQ or otherwise.
+
+On the following page there are guides to set up the proxy on Cloudflare, Netlify, etc. However, due to this IP restriction the site admin cannot host there. Normal users are still able to.
\ No newline at end of file