Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/webtor-io/torrent-http-proxy
Special proxy for webtor.io
https://github.com/webtor-io/torrent-http-proxy
Last synced: 17 days ago
JSON representation
Special proxy for webtor.io
- Host: GitHub
- URL: https://github.com/webtor-io/torrent-http-proxy
- Owner: webtor-io
- License: mit
- Created: 2019-12-16T10:52:30.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-07T02:48:05.000Z (almost 2 years ago)
- Last Synced: 2024-08-08T18:21:08.037Z (4 months ago)
- Language: Go
- Homepage: https://webtor.io
- Size: 6.53 MB
- Stars: 19
- Watchers: 3
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - webtor-io/torrent-http-proxy - Special proxy for webtor.io (others)
README
# torrent-http-proxy
Special HTTP-proxy that has several features:
1. Routes requests to internal kubernetes resources (services/jobs).
2. Deploys kubernetes job on demand.For example if path `/08ada5a7a6183aae1e09d831df6748d566095a10/Sintel%2FSintel.mp4` was called
then a new [torrent-web-seeder](https://github.com/webtor-io/torrent-web-seeder) job will be started with injected environment
variable `INFO_HASH=08ada5a7a6183aae1e09d831df6748d566095a10`. Proxy will wait until pod will be ready and then proxy requst to
it with path `/Sintel%2FSintel.mp4`. All following requests will be proxied to this pod.3. Grants HTTP-access to GRPC-services (including jobs)
4. Provides Token-authentication
5. Performs chaining of service calls (matryoshka-style)For example `/08ada5a7a6183aae1e09d831df6748d566095a10/Sintel%2FSintel.mp4~hls/index.m3u8` will be processed with following steps:
1. Proxy deploys [content-transcoder](https://github.com/webtor-io/content-transcoder) job with injected environment variable `SOURCE_URL=%PROXY_URL%/08ada5a7a6183aae1e09d831df6748d566095a10/Sintel%2FSintel.mp4`. `~hls` is the keyword that indicates what
job or service should be invoked.
2. [content-transcoder](https://github.com/webtor-io/content-transcoder) requests `SOURCE_URL` for transcoding.
3. Proxy deploys [torrent-web-seeder](https://github.com/webtor-io/torrent-web-seeder) job with injected environment variable `INFO_HASH=08ada5a7a6183aae1e09d831df6748d566095a10`.
4. Proxy serves `/index.m3u8` from [content-transcoder](https://github.com/webtor-io/content-transcoder)There might be more services in chain. There is no limitation.
## Server usage
```
% ./torrent-http-proxy help
NAME:
torrent-http-proxy - Proxies all the thingsUSAGE:
torrent-http-proxy [global options] command [command options] [arguments...]VERSION:
0.0.1COMMANDS:
help, h Shows a list of commands or help for one commandGLOBAL OPTIONS:
--host value listening host
--port value http listening port (default: 8080)
--jwt-secret value JWT Secret [$SECRET]
--redis-host value redis host (default: "localhost") [$REDIS_MASTER_SERVICE_HOST, $ REDIS_SERVICE_HOST]
--redis-port value redis port (default: 6379) [$REDIS_MASTER_SERVICE_PORT, $ REDIS_SERVICE_PORT]
--job-node-affinity-key value Node Affinity Key [$JOB_NODE_AFFINITY_KEY]
--job-node-affinity-value value Node Affinity Key [$JOB_NODE_AFFINITY_VALUE]
--job-namespace value Job namespace (default: "webtor") [$JOB_NAMESPACE]
--probe-host value probe listening host
--probe-port value probe listening port (default: 8081)
--help, -h show help
--version, -v print the version
```