btipling Posted August 31, 2009 Report Posted August 31, 2009 I'm involved at prototyping a desktop application that will try to make use of the Web API, what I'm not clear on though is determining which port the Web API is available on. In the preferences you can set it to 8080 or some other port but by default it uses the connection port which could be a random port number tens of thousands of values apart. Is there an easier way than to attempt to scan tens of thousands of ports and see if there's a response? I thought maybe the settings were accessible, but that's a binary .dat file. What options are there?Thank you.
Firon Posted August 31, 2009 Report Posted August 31, 2009 Your best bet is to have the user input a port, really. You could try to read the settings file, it's only bencoded data. 10:webui.porti####e
Ultima Posted September 1, 2009 Report Posted September 1, 2009 If the application is meant to always run only on the very machine running the µTorrent instance, then reading settings.dat is a somewhat nicer approach, but that's assuming µTorrent isn't set up as an encapsulated installation (read: settings.dat is with the EXE, and not in %appdata%\uTorrent).Unless you can guarantee those above conditions, having the user input the port is indeed the better approach. It's a more general approach, and would allow for remote connections to a WebUI on any machine instead of just the local machine too. As well, scanning ports may look malicious to some firewalls.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.