Skip to content

Commit

Permalink
Use 127.0.0.1 instead of localhost to prevent ipv6 resolution (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
rajiteh authored Oct 2, 2020
1 parent aa940ef commit 76e4462
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion multistreaming-server/nginx-conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ http {

server {
listen 80;
server_name localhost;
server_name 127.0.0.1;

#charset koi8-r;

Expand Down
12 changes: 6 additions & 6 deletions multistreaming-server/rtmp-conf-generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
notify_method get;
application %%ENDPOINT_NAME%% {
on_publish http://localhost/auth;
on_publish http://127.0.0.1/auth;
live on;
record all;
record_path /var/www/html/recordings;
Expand All @@ -35,7 +35,7 @@
live on;
record off;
# Only allow localhost to publish
# Only allow 127.0.0.1 to publish
allow publish 127.0.0.1;
deny publish all;
Expand All @@ -50,15 +50,15 @@
live on;
record off;
# Only allow localhost to publish
# Only allow 127.0.0.1 to publish
allow publish 127.0.0.1;
deny publish all;
# need to transcode
exec ffmpeg -re -i rtmp://localhost:1935/$app/$name
exec ffmpeg -re -i rtmp://127.0.0.1:1935/$app/$name
-c:v libx264 -s %%PIXEL_SIZE%% -b:v %%VIDEO_BIT_RATE%% -bufsize 12M -r 30 -x264opts "keyint=%%KFS%%:min-keyint=%%KFS%%:no-scenecut:nal-hrd=cbr"
%%AUDIO_OPTS%%
-f flv rtmp://localhost:1935/%%DEST_BLOCK_NAME%%/$name;
-f flv rtmp://127.0.0.1:1935/%%DEST_BLOCK_NAME%%/$name;
}
"""

Expand Down Expand Up @@ -169,7 +169,7 @@ def addRTMPPushConfiguration(orig_rtmp_conf, block_config, endpoint_name):
block_name = endpoint_name + '-' + block_config['name']
push_pos = orig_rtmp_conf.index(' # RTMP_PUSH_DIRECTIVE_MARKER')
rtmp_conf = orig_rtmp_conf[:push_pos] \
+ ' push rtmp://localhost/' \
+ ' push rtmp://127.0.0.1/' \
+ block_name \
+ ';\n' \
+ orig_rtmp_conf[push_pos:]
Expand Down

0 comments on commit 76e4462

Please sign in to comment.