Closed delphius closed 1 year ago
For now, I just click allow once. This is normal when dealing with networking softwares. Two or three years ago in WebUI 1.x series, many Antimalware softwares alert the users because local WebSockets and web browsers PAW and app modes was something new... now it's standardized and thankfully Antimalware does not show alerts anymore. So, one-time firewall alert is not a big deal, I guess.
I suggest to not do anything about it and just leave it.
I think this is because webui binds to all interfaces (0.0.0.0) instead of just localhost (127.0.0.1), why would it listen on all interfaces? Change that and problem solved.
I don't think so, it's already listening on 127.0.0.1
:
2 sockets on 0.0.0.0 + 1 socket on 127.0.0.1, I see it in Sysinternals Process Explorer. Also If I create sample app that listens on 127.0.0.7, no firewall windows, if I change the IP to 0.0.0.0, FW window shows up.
Thank you for sharing @fibodevy. I will investigate this.
I hooked bind() winapi function
bind called -> 127.0.0.1, socket = 0000000000000180 bind called -> 127.0.0.1, socket = 0000000000000180 bind called -> 0.0.0.0, socket = 000000000000019C bind called -> 0.0.0.0, socket = 000000000000026C
I don't know where but bind() is called 4 times
EDIT: Final word
I changed IP to 127.0.0.1 in my hooked function
addr^.sin_addr.S_addr := inet_addr('127.0.0.1');
and no more firewall windows, webui works fine, in procexp I see 3 sockets on 127.0.0.1
Please let me know if this commit fixes the issue.
[Core] [Thread] _webui_server_start([1]) -> Listening Success
[Core] [Thread] _webui_server_start([1]) -> HTTP Port: 127.0.0.1:36359
[Core] [Thread] _webui_server_start([1]) -> WS Port: 127.0.0.1:27279
If you need binaries (Compiled using GitHub CI) to update the wrappers, are here.
Yes, fixed, GJ
Thank you @fibodevy for providing useful details 👍
When you run the program for the first time, the Windows firewall window pops out, due to the fact that the program uses closed ports in the firewall for http (instead of 80) and for websocket (they are determined randomly, as far as I understand).
There are no problems pressing "allow" once, after that the program is registered in the allowed ones in the firewall and the next time you run along this path, no windows pop up anymore. However, this may confuse the end user at the first launch.
I see two working solutions so far: just close this window by finding it and sending it the WM_CLOSE command, or register the permission in the firewall yourself using the windows API (this will require increased privileges)
Now the question itself is: how do you get around this problem? (if of course you have it :)