[英]How to expose server/website/service running from WSL on local WiFi?
In a project I'm using Storybook and when running the development server of Storybook it's available on the local.network.在我使用 Storybook 的项目中,当运行 Storybook 的开发服务器时,它在 local.network 上可用。
I run the code on WSL2 on Windows 10, and I can reach the site on the stated local.network fine from my desktop browser, but not my mobile browser.我在 Windows 10 上运行 WSL2 上的代码,我可以通过我的桌面浏览器正常访问指定的 local.network 上的站点,但不能通过我的移动浏览器访问。
My desktop is connected to the router via Ethe.net, my mobile is connected to WiFi on the same router, however, I can't connect to the Storybook server on the local.network IP stated in the image above.我的桌面通过 Ethe.net 连接到路由器,我的手机连接到同一路由器上的 WiFi,但是,我无法连接到上图中所述的 local.network IP 上的 Storybook 服务器。
My IPconfig output:我的 IP 配置 output:
I've also tried connecting the Storybook server on both the IPv4 addresses above (with port 6006), but no connection.我还尝试在上面的两个 IPv4 地址(使用端口 6006)上连接 Storybook 服务器,但没有连接。
Anybody know how to expose the Storybook server running on WSL2 on my WiFi?有人知道如何在我的 WiFi 上公开运行在 WSL2 上的 Storybook 服务器吗?
There's now a simple npm
package for this.现在有一个简单的
npm
package 。
You simply have to run this before starting your dev server.您只需在启动开发服务器之前运行它。
npx expose-wsl@latest
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.