iamcco / markdown-preview.nvim

markdown preview plugin for (neo)vim
MIT License
6.82k stars 284 forks source link

[Feature Request] integrating wsl2-auto-portproxy for remote accessing to WSL2 #559

Open monologconnor opened 1 year ago

monologconnor commented 1 year ago

Hi, there!

I'm using this plugin under the WSL2 environment and I actually trying to access the preview page from another device.

The problem is even I have set the mkdp_open_to_the_world = 1 option, I still cannot access the preview page remotely since the containerized envrionment of WSL2, and I have to manually set port forwarding in my host machine so I could successfully connect to WSL2.

Then I found the wsl2-auto-proxy which automatically detects the listening port in WSL and do auto forwarding. It actually saves my effort on port forward configuration but it is still bit inconvenient to launch the auto-proxy process everytime before I start markdown previewing and to shut down the process when I was done editing.

I wonder if there is any possibility that the wsl2-auto-proxy could be integrated into markdown-preview.nvim so that the auto-proxy process could be auto-launched/closed when I toggling the :MarkdownPreviewToggle command, since WSL has the ability to execute .exe file.

It would be nice if this could be realized, thanks!

kxccc commented 1 year ago

I am also unable to remotely connect to processes within the virtual machine, but according to the documentation, this should be supported. This is likely a bug.

Cryxto commented 1 year ago

u can try this solution : https://github.com/iamcco/markdown-preview.nvim/issues/509#issuecomment-1272483338

this work for me, i am on WSL2 Ubuntu 20.04