markdown-preview.nvim icon indicating copy to clipboard operation
markdown-preview.nvim copied to clipboard

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

Open monologconnor opened this issue 1 year ago • 2 comments

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!

monologconnor avatar Mar 08 '23 13:03 monologconnor

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.

kxccc avatar Apr 11 '23 14:04 kxccc

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

Cryxto avatar Apr 12 '23 09:04 Cryxto