Improve indication of API server address #2216
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The API server is accepting commands on port 8091 of all interfaces but the about dialog shows only 127.0.0.1:8091 and it is labeled as the address of the documentation:
and the log messages print an empty string as address:
This PR tries to improve the information about the IP address in tha About dialog changing the label and using the address
0.0.0.0
as used in inhttplistener.cpp
and according to the documentation at https://doc.qt.io/qt-6/qhostaddress.html#toString which says thatQHostAddress::Any
is indicated with the address 0.0.0.0 even if it is listening on both IPv4 and IPv6.The problem is that using
0.0.0.0
and[::]
in Firefox and Chrome work in Linux but not in Windows.On Linux all the following addresses open the pages of the API server:
http://127.0.0.1:8091/
http://[::1]:8091/
http://0.0.0.0:8091/
http://[::]:8091/
plus any other address assigned to wired, wireless or virtual interfaces.
On Windows # 3 and # 4 give ERR_ADDRESS_INVALID.
An alternative would be print
0.0.0.0
in the log and127.0.0.0
in the About dialog but adding something like "and other interfaces", maybe only on Windows.