Skip to content

Commit f5e4ff1

Browse files
committed
Fixed ts files
1 parent bb8c8e2 commit f5e4ff1

File tree

10 files changed

+202
-231
lines changed

10 files changed

+202
-231
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
CORS_PROXY="https://cors.eltik.net"
2-
WEB_SERVER_URL="http://localhost:3030"
2+
WEB_SERVER_URL="https://m3u8.eltik.net"
33
WEB_SERVER_PORT="3030"

.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# CORS proxy to use. You can download a CORS proxy via https://github.com/consumet/cors-anywhere
12
CORS_PROXY="https://cors.consumet.stream"
3+
# The web server URL. This is necessary because each m3u8 and ts file will point to that URL.
4+
# For example, https://m3u8.eltik.net/ts_proxy?url=https://original.m3u8.file&headers={}
25
WEB_SERVER_URL="http://localhost:3060"
6+
# Web server port that the proxy will listen to
37
WEB_SERVER_PORT="3060"

built/libraries/M3U8Proxy.d.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
1+
/// <reference types="node" />
12
import API from "../API";
3+
import http from "http";
24
export default class M3U8Proxy extends API {
35
private url;
46
private corsProxy;
57
constructor(url: string);
6-
proxy(headers: any, reply: any): Promise<void>;
7-
proxyTs(headers: any, reply: any): Promise<void>;
8+
/**
9+
* @description Proxies m3u8 files and replaces the content to point to the proxy.
10+
* @param headers JSON headers
11+
* @param res Server response object
12+
*/
13+
proxy(headers: any, res: http.ServerResponse): Promise<void>;
14+
/**
15+
* @description Proxies TS files. Sometimes TS files require headers to be sent with the request.
16+
* @param headers JSON headers
17+
* @param req Client request object
18+
* @param res Server response object
19+
*/
20+
proxyTs(headers: any, req: any, res: http.ServerResponse): Promise<void>;
821
}

built/libraries/M3U8Proxy.js

Lines changed: 61 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

built/libraries/M3U8Proxy.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

built/server.js

Lines changed: 25 additions & 77 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)