/etc/nginx/sites-enabled/vlc
server { listen 0.0.0.0:80; server_name _; location / { proxy_pass http://127.0.0.1:8080/; proxy_redirect off; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Authorization "Basic OjEyMzQ1Ng=="; auth_basic "closed site"; auth_basic_user_file htpasswd; } }Interested line in config is:
proxy_set_header Authorization "Basic OjEyMzQ1Ng==";OjEyMzQ1Ng== - is a hash from login:password, you can generate it in console window:
$ echo ":123456" | base64 OjEyMzQ1Ngo=But vlc doesn't accept that hash, so i will sniff http trafic from my browser to vlc interface, directly, without nginx:
# tcpdump -n -w - -i en0 host 10.12.34.56 | strings | grep -i Basic tcpdump: listening on en0, link-type EN10MB (Ethernet), capture size 65535 bytes Authorization: Basic OjEyMzQ1Ng==Don't know why is it so, but in this hash there is one char less and additional = char in the end of string.
Example vlc runit script, just in case: /etc/sv/vlc/run
#!/bin/bash PLAYLIST="/home/vlc/playlist.m3u" killall vlc killall cvlc exec 2>&1 exec /bin/su - vlc -l -c "taskset 8 cvlc --http-password=123456 -vv -I http $PLAYLIST"taskset 8(process will be assigned to 4rd core, 2^3) is workaround for old bug that exist in VLC(or, at least, existed earlier): VLC player with high uptime, when linux kernel scheduler moves vlc process from core to another core and back, sound output becomes stuttering. This workaround fixes this.
Комментариев нет:
Отправить комментарий