1
0
mirror of https://gitlab.crans.org/nounous/ghostream.git synced 2025-06-28 12:02:48 +02:00

Split /app to /stream and /play

This commit is contained in:
Alexandre Iooss
2020-09-15 15:48:03 +02:00
parent f916adc2b4
commit 5f4805bd5c
7 changed files with 55 additions and 21 deletions

View File

@ -38,7 +38,7 @@ services:
- ./ovenmediaengine/conf/Server-docker.xml:/opt/ovenmediaengine/bin/origin_conf/Server.xml:ro
labels:
- "traefik.enable=true"
- "traefik.http.routers.ovenmediaengine.rule=Host(`stream.example.com`) && PathPrefix(`/app/`)"
- "traefik.http.routers.ovenmediaengine.rule=Host(`stream.example.com`) && PathPrefix(`/play/`)"
- "traefik.http.routers.ovenmediaengine.priority=101"
- "traefik.http.routers.ovenmediaengine.entrypoints=websecure"
- "traefik.http.routers.ovenmediaengine.tls.certresolver=mytlschallenge"
@ -54,7 +54,7 @@ services:
- ./nginx/nginx-docker.conf:/etc/nginx/nginx.conf:ro
labels:
- "traefik.enable=true"
- "traefik.tcp.routers.rtmp.rule=Host(`stream.example.com`)"
- "traefik.tcp.routers.rtmp.rule=HostSNI(`stream.example.com`)"
- "traefik.tcp.routers.rtmp.entrypoints=rtmpsecure"
- "traefik.tcp.routers.rtmp.tls.certresolver=mytlschallenge"
- "traefik.tcp.services.rtmp.loadbalancer.server.port=1925"

View File

@ -18,19 +18,36 @@ stream {
}
}
# Authenticate then stream RTMP
# This RTMP server will be used when clients play directly RTMPS.
# It also push RTMP stream to OvenMediaEngine to generate WebRTC stream.
rtmp {
server {
listen 127.0.0.1:1925;
chunk_size 4096;
application app {
# Application to authenticate incoming stream
application stream {
# Publish only
allow publish all;
deny play all;
live on;
record off;
push rtmp://127.0.0.1:1915;
# if publish succeed, it will redirect to /play/
on_publish http://127.0.0.1:8080/rtmp/auth;
}
# Application to play stream
application play {
# Playback only
allow publish 127.0.0.1;
deny publish all;
allow play all;
live on;
record off;
# Send to OvenMediaEngine
push rtmp://127.0.0.1:1915;
}
}
}

View File

@ -10,19 +10,36 @@ events {
worker_connections 768;
}
# Authenticate then stream RTMP
# This RTMP server will be used when clients play directly RTMPS.
# It also push RTMP stream to OvenMediaEngine to generate WebRTC stream.
rtmp {
server {
listen 0.0.0.0:1925;
chunk_size 4096;
application app {
# Application to authenticate incoming stream
application stream {
# Publish only
allow publish all;
deny play all;
live on;
record off;
push rtmp://ovenmediaengine:1915;
# if publish succeed, it will redirect to /play/
on_publish http://ghostream:8080/rtmp/auth;
}
# Application to play stream
application play {
# Playback only
allow publish 127.0.0.1;
deny publish all;
allow play all;
live on;
record off;
# Send to OvenMediaEngine
push rtmp://ovenmediaengine:1915;
}
}
}

View File

@ -56,7 +56,7 @@ server {
}
# Pass WebSocket to OvenMediaEngine for WebRTC signalling
location /app/ {
location /play/ {
proxy_pass http://127.0.0.1:3333;
proxy_redirect off;
proxy_http_version 1.1;