![](/img/trans.png)
[英]How to open create-react-app from another computer/mobile device outside same network (LAN)
[英]Make create-react-app available to computers outside of local network
我希望運行我的 react-app 並使其可供本地網絡之外的計算機訪問。 我希望有人能夠輸入:3000(或其他安全端口)並能夠看到我的應用程序。 如果不使用像 Netlify 這樣的托管服務,這可能嗎? 顯然存在安全問題,但這主要是為了對我正在創建的視頻播放器進行網絡外測試。
謝謝你。
只需運行HOST=0.0.0.0 npm run start
。 然后從網絡上的另一台設備打開 url。
Find whatever your ip is through ipconfig
on cmd in windows and then for eg replace this ip with what your ip is: 192.153.23.10:3000 would work.
進一步閱讀: 文檔
還有一項名為Ngrok的出色服務,它可以將 https 安全地址分配給本地主機應用程序。 我知道如何使它與 express 和 next js 一起使用,但是那里也會有一些適合您的東西,請檢查一下。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.