-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
37 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,40 @@ | ||
# HLS Stream Proxy | ||
|
||
This application serves as a proxy for HLS streams. It allows you to securely access and stream media content by passing through a proxy endpoint. | ||
This application serves as a proxy for HLS streams, enabling secure access to media content. | ||
|
||
## Usage Instructions | ||
--- | ||
|
||
To use this application, please follow the instructions below. | ||
## Proxy Endpoint | ||
|
||
### Proxy Endpoint | ||
|
||
The proxy endpoint can be accessed using the following format: | ||
Use the following format to access the proxy: | ||
|
||
``` | ||
/proxy?url=<encoded_m3u8_url>&headers=<encoded_headers> | ||
``` | ||
|
||
- **`encoded_m3u8_url`**: Base64-encoded URL of the M3U8 file you want to stream. | ||
- **`encoded_headers`**: Base64-encoded JSON string of any custom headers needed for the request. | ||
|
||
### Why base64Encoding? | ||
- **`url`**: Base64-encoded M3U8 URL. | ||
- **`headers`**: (Optional) Base64-encoded JSON string for custom headers. | ||
|
||
Because it looks cool | ||
--- | ||
|
||
### Encoding the M3U8 URL | ||
## Encoding Instructions | ||
|
||
To encode the M3U8 URL, use the `base64` encoding method. For example, using JavaScript: | ||
### Encode M3U8 URL: | ||
|
||
```javascript | ||
const encodedUrl = btoa('http://example.com/stream.m3u8'); | ||
btoa('http://example.com/stream.m3u8'); | ||
``` | ||
|
||
### Encoding the Headers | ||
|
||
To encode the headers, you can use the following JavaScript code: | ||
### Encode Headers (if needed): | ||
|
||
```javascript | ||
const headers = JSON.stringify({ Authorization: 'Bearer token' }); | ||
const encodedHeaders = btoa(headers); | ||
btoa(JSON.stringify({ Referrer: 'https://anitaku.bz' })); | ||
``` | ||
|
||
Ensure that the headers are in valid JSON format before encoding. | ||
--- | ||
|
||
## Example | ||
|
||
Here’s an example of how to construct a request to the proxy: | ||
## Example Request | ||
|
||
``` | ||
/proxy?url=aHR0cDovL2V4YW1wbGUuY29tL3N0cmVhbS5tM3U4&headers=eyJBdXRob3JpemF0aW9uIjoiQmVhcmVyIHRva2VuIn0= | ||
``` | ||
|
||
## Deploy Your Instance | ||
|
||
You can deploy your own instance of this application on Cloudflare Workers by clicking the button below: | ||
|
||
[](https://deploy.workers.cloudflare.com/?url=https://github.com/Toasty360/Roxy) | ||
|
||
## Contributing | ||
|
||
If you would like to contribute to this project, please fork the repository and submit a pull request. | ||
|
||
## License | ||
|
||
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters