mirror of
https://github.com/p-stream/simple-proxy.git
synced 2026-01-11 20:10:35 +00:00
Switch cache control to ENABLE_CACHE env variable
Some checks failed
Linting and Testing / Run Linters (push) Has been cancelled
Linting and Testing / Build project (push) Has been cancelled
Linting and Testing / Build docker (push) Has been cancelled
Docker Publish / build (push) Has been cancelled
Release / Release (push) Has been cancelled
Some checks failed
Linting and Testing / Run Linters (push) Has been cancelled
Linting and Testing / Build project (push) Has been cancelled
Linting and Testing / Build docker (push) Has been cancelled
Docker Publish / build (push) Has been cancelled
Release / Release (push) Has been cancelled
Changed caching logic to use ENABLE_CACHE (disabled by default) instead of DISABLE_CACHE. Updated documentation and bumped version to 2.2.4 for clarity and consistency.
This commit is contained in:
parent
f7d3c4f485
commit
ec3692d9e3
4 changed files with 6 additions and 6 deletions
|
|
@ -11,7 +11,7 @@ Read the docs at https://docs.pstream.org/proxy/introduction
|
||||||
- bypass CORS - always allows browser to send requests through it
|
- bypass CORS - always allows browser to send requests through it
|
||||||
- secure it with turnstile - prevent bots from using your proxy
|
- secure it with turnstile - prevent bots from using your proxy
|
||||||
- parse and bypass m3u8 stream restrictions - make sure the IP is not blocked by the CDN, may need to be on a VPS.
|
- parse and bypass m3u8 stream restrictions - make sure the IP is not blocked by the CDN, may need to be on a VPS.
|
||||||
- Caching of tls segments (disable with DISABLE_CACHE=true in .env)
|
- Caching of tls segments (enable with ENABLE_CACHE=true in .env, disabled by default)
|
||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> Turnstile integration only works properly with cloudflare workers as platform
|
> Turnstile integration only works properly with cloudflare workers as platform
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "simple-proxy",
|
"name": "simple-proxy",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "2.2.3",
|
"version": "2.2.4",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "nitropack prepare",
|
"prepare": "nitropack prepare",
|
||||||
"dev": "nitropack dev",
|
"dev": "nitropack dev",
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { setResponseHeaders } from 'h3';
|
import { setResponseHeaders } from 'h3';
|
||||||
|
|
||||||
// Check if caching is disabled via environment variable
|
// Check if caching is enabled via environment variable (disabled by default)
|
||||||
const isCacheDisabled = () => process.env.DISABLE_CACHE === 'true';
|
const isCacheDisabled = () => process.env.ENABLE_CACHE !== 'true';
|
||||||
|
|
||||||
function parseURL(req_url: string, baseUrl?: string) {
|
function parseURL(req_url: string, baseUrl?: string) {
|
||||||
if (baseUrl) {
|
if (baseUrl) {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import { setResponseHeaders } from 'h3';
|
import { setResponseHeaders } from 'h3';
|
||||||
import { getCachedSegment } from './m3u8-proxy';
|
import { getCachedSegment } from './m3u8-proxy';
|
||||||
|
|
||||||
// Check if caching is disabled via environment variable
|
// Check if caching is enabled via environment variable (disabled by default)
|
||||||
const isCacheDisabled = () => process.env.DISABLE_CACHE === 'true';
|
const isCacheDisabled = () => process.env.ENABLE_CACHE !== 'true';
|
||||||
|
|
||||||
export default defineEventHandler(async (event) => {
|
export default defineEventHandler(async (event) => {
|
||||||
// Handle CORS preflight requests
|
// Handle CORS preflight requests
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue