Gluetun x StremThru

Proxy stremio addons through your server

Repo URL: https://github.com/MunifTanjim/stremthru

Common usage for this is to run plex and stremio both with your debrid provider, in case they don't allow multiple IP.


I have made a caddy network for reverse proxy with docker network create -d bridge caddy. Even if you don't use caddy you should still have to make a common network to connect with containers in different compose files.

StremThru

containers/stremthru/docker-compose.yml

services:
    stremthru:
        container_name: stremthru
        image: muniftanjim/stremthru:latest-heavy
        ports:
            - 9001:8080
        env_file:
            - .env
        restart: unless-stopped
        volumes:
            - ./data:/app/data # mkdir data in same folder
        depends_on:
            - redis
    redis:
        container_name: redis-stremthru
        image: redis:7-alpine
        command: redis-server /etc/redis/redis.conf
        volumes:
            - redis_data:/data
            - ./redis.conf:/etc/redis/redis.conf:ro
            - ./users.acl:/etc/redis/users.acl:ro
        healthcheck:
            test: ["CMD", "redis-cli", "--raw", "incr", "ping"]

volumes:
    redis_data:

networks:
    default:
        name: caddy
        external: true

containers/stremthru/redis.conf

1
2
3
4
maxmemory 2048mb
maxmemory-policy allkeys-lru
appendonly no
aclfile /etc/redis/users.acl

containers/stremthru/users.acl

user stremthru on >stremthru ~* &* +@all

containers/stremthru/.env

1
2
3
4
5
6
7
8
9
STREMTHRU_HTTP_PROXY=http://gluetun:8888
STREMTHRU_TUNNEL=*:false,torrentio.strem.fun:true
STREMTHRU_STORE_TUNNEL=*:false
STREMTHRU_PROXY_AUTH=username:password
STREMTHRU_STORE_AUTH=username:realdebrid:apitoken
STREMTHRU_PEER_URI=https://stremthru.mooo.com
STREMTHRU_REDIS_URI=redis://stremthru:stremthru@redis-stremthru:6379
STREMTHRU_DATABASE_URI=sqlite://./data/stremthru.db
# STREMTHRU_STREMIO_ADDON=

Redis is optional, without Redis it will use in-memory storage. You can remove redis and STREMTHRU_REDIS_URI to use in-memory storage

More info on these in the repo

Gluetun

containers/gluetun/docker-compose.yml

services:
    gluetun:
        container_name: gluetun
        image: qmcgaw/gluetun
        cap_add:
            - NET_ADMIN
        devices:
            - /dev/net/tun:/dev/net/tun
        ports:
            - 127.0.0.1:8888:8888/tcp # HTTP proxy
        volumes:
            - gluten:/gluetun
        environment:
            - VPN_SERVICE_PROVIDER=windscribe # your provider
            - VPN_TYPE=wireguard
            - WIREGUARD_PRIVATE_KEY=...
            - WIREGUARD_ADDRESSES=...
            - WIREGUARD_PRESHARED_KEY=...
            - WIREGUARD_ENDPOINT_PORT=443
            - SERVER_REGIONS=India
            - SERVER_CITIES=Mumbai
            - HTTPPROXY=on

volumes:
    gluten:

networks:
    default:
        name: caddy
        external: true

You can find provider related settings and info here https://github.com/qdm12/gluetun-wiki/tree/main/setup/providers

With this setup, all requests to torrentio.strem.fun domain will be done via proxy but the rest (including the streams) will go through your oracle server

Running

Run the gluetun compose file first and then the stremthru compose file.

Setup

Once you are done and running, go to https://stremthru.domain.com/stremio/store/configure and choose Store Name StremThru and Store Token is your username:password from .env (STREMTHRU_PROXY_AUTH) base64 hashed. You can do it easily with terminal using

echo -n 'username:password' | base64

Copy the output of this and paste as Store Token. Now install it to Stremio and you should be able to see your library in Discover > Other > Store. Try to play something from there and then go to https://real-debrid.com/downloads and see if the ip for the file you ran is your VPS/server IP (not VPN!) or your IP. If it's not your server ip then something is wrong.

Anyways if it's your VPS/server IP then you are good to add Torrentio & Mediafusion

Mediafusion

Let's start with Mediafusion since it has integrated StremThru support. You can host your own mediafusion instance or use public instance like https://mediafusion.elfhosted.com/

Go to mediafusion and configure it. Go newbie/pro mode your wish.

In Streaming Provider Configuration choose Stremthru as Streaming Provider. Then in service url enter your instance url like https://stremthru.domain.com . Let store name be default (empty) and token is your base64 encoded username:password.
Select only cached content streams (preferred) and the rest you can configure.

Then just install it.

Torrentio

To add torrentio, go to https://torrentio.strem.fun and then configure your preferences. Let Debrid Provider be none, StremThru will handle it. Then right click on install and copy the link. Replace stremio:// with https://

Example manifest link

https://torrentio.strem.fun/providers=yts,eztv,rarbg,1337x,thepiratebay,kickasstorrents,torrentgalaxy,magnetdl,horriblesubs,nyaasi,tokyotosho,anidex|qualityfilter=threed,720p,480p,other,scr,cam/configure

Now go to your stremthru instance and then wrap https://stremthru.domain.com/stremio/wrap/configure

There put the manifest link above ^^ in Upstream Manifest URL . Store Name is StremThru and Store Token is your base64 encoded username:password.

Make sure to select Only Show Cached Content and then install. That's it.


If this project helped you support Munif Tanjim

Guide written by Mini

Edit Report
Pub: 07 Feb 2025 15:38 UTC
Views: 209