pstream is dead; long live pstream taciturnaxolotl.github.io/pstream-ng/
at main 221 lines 7.3 kB view raw
1--- 2title: 'Deploy' 3--- 4 5# Deploying the proxy 6 7<Warning> 8**USERS!** 9 10Please use the extension instead unless you are familiar with self hosting Docker images! 11</Warning> 12 13 14<Warning> 15**Selfhosting the client as well?** 16 17Please read [THIS](./introduction.mdx) and use Method 1 (Docker) or Method 2 (Manual)! 18 19Cloudflare and Netlify's IPs are blocked by most sites and the proxy MUST be hosted on a VPS or other server that is not IP/ASN banned. 20 21</Warning> 22 23## Method 1 - Docker (Recommended) 24 25This is the recommended method for deploying on a VPS or home server. Experience with Docker, domains and web hosting is recommended. 26 27<Warning> 28 Experience with Docker, domains and web hosting is **highly recommended** for 29 this method. <br /> 30 You are exposing your server at your own risk! 31</Warning> 32 33P-Stream does not have a Docker image for the proxy, but there is a Dockerfile within the repo. 34 35<Steps> 36 <Steps.Step> 37 Clone the repo on your server: 38 <code>git clone https://github.com/p-stream/simple-proxy</code> 39 </Steps.Step> 40 41 <Steps.Step> 42 Locate the <code>Dockerfile</code> in the root folder. 43 </Steps.Step> 44 45 <Steps.Step> 46 Build the Docker image: 47 <code>docker build -t p-stream-proxy ./simple-proxy</code> 48 </Steps.Step> 49 50 <Steps.Step> 51 (Optional) Create and edit a <code>.env</code> file in the <code>simple-proxy</code> directory to configure secrets such as <code>JWT_SECRET</code> and other environment variables as documented in the configuration guide. 52 </Steps.Step> 53 54 <Steps.Step> 55 Run the Docker container (replace values as needed): 56 <code>docker run -d --name p-stream-proxy -p 3000:3000 --env-file .env p-stream-proxy</code> 57 </Steps.Step> 58 59 <Steps.Step> 60 (Optional) Configure your firewall or reverse proxy (such as NGINX or Caddy) to expose port <code>3000</code> or your desired HTTP/HTTPS port. 61 </Steps.Step> 62</Steps> 63 64 65The container exposes the HTTP port (Without TLS/SSL) as `3000/TCP`. 66 67## Method 2 - Manual (Advanced) 68 69This method is for advanced users who want full control over their deployment. We recommend using automated package managers like nixpacks for easier deployment. 70 71Manually installing the proxy on your server. You may want to use an automated package manager like nixpacks to do this. 72 73<Steps> 74 <Steps.Step> 75 Clone the repo on your server `git clone https://github.com/p-stream/simple-proxy` 76 </Steps.Step> 77 78 <Steps.Step> 79 Navigate to the directory `cd simple-proxy` 80 </Steps.Step> 81 82 <Steps.Step> 83 Install packages `pnpm i` 84 </Steps.Step> 85 86 <Steps.Step> 87 Build the app `pnpm build` 88 </Steps.Step> 89 90 <Steps.Step> 91 Start the proxy `pnpm start` 92 </Steps.Step> 93</Steps> 94 95You'll need to configure port forwarding and firewall settings. Good luck. 96 97--- 98 99# Deprecated Methods 100 101<Warning> 102**These methods are DEPRECATED** and should not be used for new deployments. Cloudflare, Netlify, and Railway IPs have been heavily abused and are now blocked by most streaming sites. Use Docker or Manual deployment on a VPS or home server with a residential/private IP instead. 103</Warning> 104 105## Method 3 - Cloudflare (DEPRECATED) 106 107Cloudflare has a generous free plan, so you don't need to pay anything unless you get thousands of users. 108 109[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/p-stream/simple-proxy) 110 111<Steps> 112 <Steps.Step> 113 Create a GitHub account at https://github.com if you don't have one. 114 </Steps.Step> 115 116 <Steps.Step>Click the `Deploy with workers` button above.</Steps.Step> 117 118 <Steps.Step>Configure any aditional settings if desired.</Steps.Step> 119 120 <Steps.Step>Click `Deploy` to deploy to Cloudflare Workers.</Steps.Step> 121 122 <Steps.Step> 123 Congratulations! Your worker is now deploying. Please wait for the GitHub 124 Action to build and publish your worker. 125 </Steps.Step> 126 127 <Steps.Step> 128 You can click the [`Worker 129 dash`](https://dash.cloudflare.com/sign-up?to=/:account/workers-and-pages) 130 and `GitHub repo` buttons to see the status of the deploy. 131 </Steps.Step> 132 133 <Steps.Step> 134 When the worker has deployed, you will need to take note of the URL. This 135 can be found on Cloudflare under [Workers and Pages -> 136 Overview](https://dash.cloudflare.com/sign-up?to=/:account/workers-and-pages) 137 -> Proxy. 138 </Steps.Step> 139 140 <Steps.Step> 141 Use the URL you took note of and [set up a custom proxy in the 142 client](../extra/streaming.mdx#method-1-self-hosted-proxy). 143 </Steps.Step> 144</Steps> 145 146## Method 4 - Netlify (DEPRECATED) 147 148Netlify has a very generous free plan, so you'll be able to host your proxy for free unless you get hundreds of users. 149 150[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/p-stream/simple-proxy) 151 152<Steps> 153 <Steps.Step> 154 Create a GitHub account at https://github.com/signup if you don't have one already. 155 </Steps.Step> 156 157{' '} 158<Steps.Step> 159 Click on the `Deploy to Netlify` button above. - Authorize Netlify to connect 160 with GitHub by clicking the `Connect to GitHub` button. 161</Steps.Step> 162 163{' '} 164<Steps.Step>There should now be a `Save & Deploy` button, click it.</Steps.Step> 165 166{' '} 167<Steps.Step> 168 Once the deployment is complete, click on the `Get Started` button that pops 169 up, this will redirect you to the dashboard of your site. 170</Steps.Step> 171 172{' '} 173<Steps.Step> 174 Click on the only site in the `Sites` section of your dashboard. 175</Steps.Step> 176 177 <Steps.Step> 178 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](../extra/streaming.mdx#method-1-self-hosted-proxy)! 179 </Steps.Step> 180</Steps> 181 182## Method 5 - Railway (DEPRECATED) 183 184Railway provides $5 in free credits once you verify your account. These credits expire after 1 month and are usually enough to keep the proxy running for about that time. 185(Tip: You can delete your account and create a new one to receive additional credits.) 186 187[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/dyYHq1) 188 189<Steps> 190 <Steps.Step> 191 Login to your [Railway](https://railway.app) account if you have one, otherwise create one [here](https://railway.app/login). 192 - If you are signing up, then verify your account by clicking the link in the email Railway sends you. 193 - 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. 194 </Steps.Step> 195 196{' '} 197<Steps.Step> 198 Click the [`Deploy on Railway`](https://railway.app/template/dyYHq1) button 199 above. 200</Steps.Step> 201 202{' '} 203<Steps.Step> 204 If a `Configure` button is displayed, click on it and allow Railway to access 205 your GitHub account. 206</Steps.Step> 207 208{' '} 209<Steps.Step> 210 The `Deploy` button at the bottom of the template should be active, click on 211 it. 212</Steps.Step> 213 214 <Steps.Step> 215 Once the proxy has deployed, copy the URL from the `Deployments` page. 216 </Steps.Step> 217 218 <Steps.Step> 219 Congratulations! You have deployed the proxy, [you can now set up the client](../extra/streaming.mdx#method-1-self-hosted-proxy). 220 </Steps.Step> 221</Steps>