配置文件
在Windows 用戶的根目錄創(chuàng)建.wslconfig
文件,配置以下的內(nèi)容:
[experimental]
networkingMode=mirrored
dnsTunneling=true
firewall=true
autoProxy=true
hostAddressLoopback=true
這樣在wsl 子系統(tǒng)中起的Web Server 服務(wù),局域網(wǎng)內(nèi)可通過Windows 宿主機的IP:Port 來進行訪問,注意:Web Server 服務(wù)需要監(jiān)聽0.0.0.0
地址。