yellobyte / SoapESP32

Scan local network for DLNA media servers, browse their content and download files. For ESP32 devices.
MIT License
61 stars 7 forks source link

Doubt about PORT #5

Closed mircose closed 2 years ago

mircose commented 2 years ago

First of all, thanks for sharing this great library! hi, I have check your library, and scan dlna server work very well. I use the FritzBox as mediaserver and with example ScanForMediaServers_WiFi.ino I found:

ScanForMediaServers_WiFi

Also other examples work fine. If I use VLC to scan Server obtain (the same thing): upnp://http://192.168.178.1:49000/MediaServer/ContentDirectory/Control&ObjectID=0

but if I use VLC to obtain URL of single file I obtain: http://192.168.178.1:49200/AUDIO/DLNA-1-0/SANDISK_32G/MUSICA/MP3/Alcazar%20-%20Crying%20at%20the%20discoteque.mp3

The PORT is different! and If I use URL with PORT 49200 in browser it's work. I hope someone wants to tell me why there is this difference. It's possible obtain the port suitable for URL in browser? Thank you.

mircose commented 2 years ago

ok i solved. I use object-> downloadPort and object-> downloadIp to make the html address valid to use in a browser. the value of object-> downloadIp is 49200 the same of vlc. Thank you.

yellobyte commented 2 years ago

Hi there, it's not uncommon for the ports to be different. Even the ip address can differ. Thats why structure "soapObject_t" defined in SoapESP32.h has 2 separate variables for it. The services for "content directory" and "file delivery" can theoretically run on different machines and then would carry different IPs & port numbers.

struct soapObject_t { bool isDirectory; // true if directory ....... String uri; // item URI on server, needed for download with GET IPAddress downloadIp; // download IP can differ from server IP <----- !!!!!! uint16_t downloadPort; // download port can differ from server control port <----- !!!!!! };

MinimServer also provides different port numbers, just as an example.

Thanks for using the library and giving me feedback. I appreciate it. If you like the lib, please git it a star ! :-)))

Thanks Thomas

yellobyte commented 2 years ago

👍 ☺️ Thanks ! If anything else is not clear, come back to me. Regards Th