简体   繁体   English

如何解决我的 Meteor Android 应用程序无法连接的问题?

[英]How do I resolve this issue where my Meteor Android app doesn't connect?

I'm trying to run my Meteor Android app on my phone, the app installs on the phone as expected but it doesn't connect, it seems to be a problem creating a websocket based on the IP address of the phone.我正在尝试在我的手机上运行我的 Meteor Android 应用程序,该应用程序按预期安装在手机上但未连接,根据手机的 IP 地址创建 websocket 似乎是一个问题。

Could this be an something relating to setting up a proxy service on Windows 11 to allow connections to the WSL virtual machine?这可能与在 Windows 11 上设置代理服务以允许连接到 WSL 虚拟机有关吗?

Update : I've installed a.network analysis app on my phone and I can ping my Ubuntu IP address 192.168.115.214 but port 3000 is blocked. Update :我在我的手机上安装了一个网络分析应用程序,我可以 ping 我的 Ubuntu IP 地址192.168.115.214但端口 3000 被阻止。 If I open a browser on my win 11 laptop and go to 192.168.115.214:3000 my app appears.如果我在 win 11 笔记本电脑和 go 到192.168.115.214:3000上打开浏览器,我的应用程序就会出现。

in the dev tools I get this:在开发工具中我得到这个:

在此处输入图像描述

In my app:在我的应用程序中:

ROOT_URL=https://192.168.1.101:3000 meteor run --mobile-server 192.168.1.101:3000 android-device --port=3000

Mobile Phone IP:手机IP:

192.168.1.101

Windows (11): Windows (11):

PS C:\WINDOWS\system32> ipconfig

Windows IP Configuration


Wireless LAN adapter Local Area Connection* 1:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix  . :

Wireless LAN adapter Local Area Connection* 2:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix  . :

Wireless LAN adapter WiFi:

Connection-specific DNS Suffix  . :
IPv6 Address. . . . . . . . . . . : ::acdb:90ff:ec22:b5d
Temporary IPv6 Address. . . . . . : ::f1a3:d3f5:e2f1:8baa
Link-local IPv6 Address . . . . . : fe80::acdb:90ff:ec22:b5d%8
IPv4 Address. . . . . . . . . . . : 192.168.1.105
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1

Ethernet adapter Bluetooth Network Connection:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix  . :

Ethernet adapter vEthernet (WSL):

Connection-specific DNS Suffix  . :
Link-local IPv6 Address . . . . . : fe80::d510:778:9360:2b5c%25
IPv4 Address. . . . . . . . . . . : 192.168.112.1
Subnet Mask . . . . . . . . . . . : 255.255.240.0
Default Gateway . . . . . . . . . :
PS C:\WINDOWS\system32>

Ubuntu (WSL): Ubuntu (华语):

$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    inet 192.168.115.214  netmask 255.255.240.0  broadcast 192.168.127.255
    inet6 fe80::215:5dff:fe08:2510  prefixlen 64  scopeid 0x20<link>
    ether 00:15:5d:08:25:10  txqueuelen 1000  (Ethernet)
    RX packets 90695  bytes 28825428 (28.8 MB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 19863  bytes 3402580 (3.4 MB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Your phone should be connected to the same Wifi.network and you need to enter your.network ip address您的手机应该连接到同一个 Wifi.network 并且您需要输入您的.network ip 地址

and you can run你可以跑

meteor run --settings settings.json android-device --port http://<IP-ADDR>:3000 --mobile-server=http://<IP-ADDR>:3000

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将我的Android应用程序连接到远程MySQL数据库? - How do I connect my Android app to a remote MySQL database? 如何将我的 Android 应用程序连接到后端? - How do I connect my Android app to backend? 流星android应用程序将无法连接到服务器 - meteor android app won't connect to server 没有焦点时如何保持我的Android应用运行? - How do I keep my Android app running when it doesn't have focus? 为什么我的 android 应用程序无法连接到数据库? - Why does my android app doesn't connect to the database? 我正在使用一个Firebase android代码实验室来创建一个像friendlychat这样的应用程序,由于某种原因,它不允许我构建apk。 我该如何解决? - I am using a firebase android codelab to create an app like friendlychat and for some reason it doesn't let me build the apk. How do I resolve this? 如何将数据库连接到 Android 应用程序? - How do I connect a database to an Android app? 如何将 webapp 与 android 应用程序连接起来? - How do I connect webapp with android app? 如何在Meteor中升级我的Android目标API - How do i upgrade my android target API in Meteor 仅当我的 Android 应用程序不存在时才插入记录,否则如何显示 Toast 或消息? - How do I make my Android app insert record only if it doesn't exist else display a Toast or Message?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM