Closed mojabyte closed 1 year ago
Hello @HassanMojab, thanks for the heads up!
It seems that it comes from an upstream problem on WSL https://github.com/microsoft/WSL/issues/8892. As I'm using a fork of openurl I will do two things:
Try to find a workaround for WSL to be able to keep that auto open behavior (some workarounds are discussed here). The thing is I'm not running WSL myself, so will be hard for me to reproduce and be sure to fix the problem.
Fix the uncaught exception in the library I'm using that should be handled properly and not make the process crash (upstream, not in skott). This would have for consequence to not open the browser automatically but would allow the application to be accessible anyway.
@HassanMojab, I just released an attempt to a fix for WSL in 0.30.1
.
In the best scenario wslview
works as expected and the browser will be automatically opened.
In the worst scenario, wslview
does not work but now the error is properly managed so the process won't crash and you'll be able to access the application manually. If you have any suggestion to properly use wslview
or an alternative as I'm not familiar at all with it, feel free to re-open the issue and keep the discussion going on.
Thanks
The wslview
is not installed on wsl by default. I've found this command for opening a URL on the Windows default browser from wsl:
cmd.exe /C start "http://127.0.0.1:40000" > /dev/null 2>&1
Ah fml I was too confident about it π I'll add your cmd.exe in another PR as a primary target when being in WSL. Thanks for the hint! I reopen the issue
Hey again @HassanMojab,
Just released 0.30.2
switching for cmd.exe
instead of wslview
. Could you please confirm me that it now works well please? I'll wait until then to close the issue.
Thanks!
It works! the browser opens with the given URL 127.0.0.1:<port>
But unfortunately, there is still an issue :( 127.0.0.1 is considered as localhost in linux, but not in windows. So the ports of wsl are forwarded to the localhost of the windows and can be accessed by localhost:<port>
but not by 127.0.0.1:<port>
.
I think you simply can use localhost instead of 127.0.0.1 in the code like other cross-platform applications, and it should solve this problem.
Glad to hear that the auto opening is working as expected on WSL :)
About localhost, I was not aware of that and I thought WSL would manage this transparently. Thanks for the hint! I just changed 127.0.0.1
to localhost
on all platforms in 0.30.3
.
Could you please test it and confirm me that it now fully works? Thanks again for your reactivity and contribution, highly appreciate it
Now it fully works!
Thanks again for confirming that @HassanMojab!
Running in WSL (Windows Subsystem Linux) throws an error when trying to open the webapp URL: