Jump to content

Determining the Web API port from a third party application


btipling

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...