Aggiorna README.md
This commit is contained in:
parent
d3657cfd2b
commit
683b70ae30
1 changed files with 24 additions and 13 deletions
37
README.md
37
README.md
|
|
@ -1,4 +1,7 @@
|
||||||
🔥 COME ABBIAMO SBLOCCATO MACOS PER PERMETTERE IL MULTICAST SSDP
|
# DLNA receiver per MacOS
|
||||||
|
|
||||||
|
|
||||||
|
### SBLOCCARE MACOS PER PERMETTERE IL MULTICAST SSDP
|
||||||
macOS blocca il multicast UDP in uscita per processi non autorizzati,
|
macOS blocca il multicast UDP in uscita per processi non autorizzati,
|
||||||
anche se il firewall è disattivato.
|
anche se il firewall è disattivato.
|
||||||
|
|
||||||
|
|
@ -7,9 +10,10 @@ Per questo il tuo Python diceva “SSDP sent”, ma non usciva nulla sulla rete.
|
||||||
✔️ 1. Abbiamo autorizzato Python nel firewall di macOS
|
✔️ 1. Abbiamo autorizzato Python nel firewall di macOS
|
||||||
Se usi Python di sistema:
|
Se usi Python di sistema:
|
||||||
|
|
||||||
Codice
|
```
|
||||||
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add /usr/bin/python3
|
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add /usr/bin/python3
|
||||||
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblockapp /usr/bin/python3
|
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblockapp /usr/bin/python3
|
||||||
|
```
|
||||||
|
|
||||||
Questo è il passaggio fondamentale:
|
Questo è il passaggio fondamentale:
|
||||||
senza questa autorizzazione, macOS non invia multicast.
|
senza questa autorizzazione, macOS non invia multicast.
|
||||||
|
|
@ -17,40 +21,47 @@ senza questa autorizzazione, macOS non invia multicast.
|
||||||
✔️ 2. Abbiamo abilitato le app firmate a inviare multicast
|
✔️ 2. Abbiamo abilitato le app firmate a inviare multicast
|
||||||
macOS ha due flag nascosti che, se disattivati, bloccano il multicast:
|
macOS ha due flag nascosti che, se disattivati, bloccano il multicast:
|
||||||
|
|
||||||
Codice
|
```
|
||||||
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setallowsigned on
|
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setallowsigned on
|
||||||
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setallowsignedapp on
|
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setallowsignedapp on
|
||||||
|
```
|
||||||
Questi due comandi dicono al firewall:
|
Questi due comandi dicono al firewall:
|
||||||
|
|
||||||
“Lascia passare il traffico multicast delle app firmate (come Python).”
|
“Lascia passare il traffico multicast delle app firmate (come Python).”
|
||||||
✔️ 3. Abbiamo verificato con tcpdump
|
✔️ 3. Abbiamo verificato con tcpdump
|
||||||
Dopo la patch:
|
Dopo la patch:
|
||||||
|
|
||||||
Codice
|
si può verificare con
|
||||||
|
```
|
||||||
sudo tcpdump -i en0 udp port 1900
|
sudo tcpdump -i en0 udp port 1900
|
||||||
|
```
|
||||||
E finalmente hai visto:
|
E finalmente hai visto:
|
||||||
|
|
||||||
Codice
|
```
|
||||||
IP 192.168.1.2 > 239.255.255.250:1900 UDP
|
IP 192.168.1.2 > 239.255.255.250:1900 UDP
|
||||||
|
```
|
||||||
→ Conferma che macOS ora lascia uscire i pacchetti SSDP.
|
→ Conferma che macOS ora lascia uscire i pacchetti SSDP.
|
||||||
|
|
||||||
DIPENDENZE minime
|
### DIPENDENZE minime
|
||||||
|
|
||||||
|
```
|
||||||
pip install flask netifaces
|
pip install flask netifaces
|
||||||
|
```
|
||||||
|
|
||||||
DIPENDENZE per altri test DLNA
|
### DIPENDENZE per altri test DLNA
|
||||||
|
|
||||||
lxml → per fare parsing XML più robusto (prima di passare a parsing manuale)
|
lxml → per fare parsing XML più robusto (prima di passare a parsing manuale)
|
||||||
requests → per testare SOAP verso TV reali
|
requests → per testare SOAP verso TV reali
|
||||||
flask → già incluso, ma reinstallato
|
flask → già incluso, ma reinstallato
|
||||||
|
```
|
||||||
pip install flask lxml requests
|
pip install flask lxml requests
|
||||||
|
```
|
||||||
|
|
||||||
COME AVVIARE
|
## COME AVVIARE
|
||||||
|
```
|
||||||
python3 dlna_receiver.py
|
python3 dlna_receiver.py
|
||||||
|
```
|
||||||
ma va avviato anche VLC in modalità player DLNA
|
ma va avviato anche VLC in modalità player DLNA
|
||||||
|
```
|
||||||
/Applications/VLC.app/Contents/MacOS/VLC --extraintf rc --rc-host localhost:9999
|
/Applications/VLC.app/Contents/MacOS/VLC --extraintf rc --rc-host localhost:9999
|
||||||
|
```
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue