React Native - 无法连接到开发服务器

时间:2016-05-11 01:55:10

标签: react-native

这个错误让我疯了。我在我的AppDelegate.m中更改了IP,我连接到笔记本电脑和iphone上的相同wifi,但我仍然收到此错误。出于某种原因,当我在我的工作wifi上而不是在我的家庭wifi上时,它可以工作。有人有什么想法吗?

1 个答案:

答案 0 :(得分:0)

您需要更改文件上的IP

node_modules/react-native/Libraries/WebSocket/RCTWebSocketExecutor.m

更改行

NSString *URLString = [NSString stringWithFormat:@"http://localhost:%zd/debugger-proxy?role=client", port];

localhost更改为您当前的IP。

相关问题