Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

Android "websocket: connection error", "Failed to connect to localhost/127.0.0.1:7007" #107

Closed
tracyxiong1 opened this issue Oct 31, 2016 · 4 comments

Comments

@tracyxiong1
Copy link

Hi, there was an error on the Android platform, working on the iOS.
Error message is " websocket: connection error", "Failed to connect to localhost/127.0.0.1:7007".

npm i -g getstorybook
cd my-react-app
getstorybook

react-native 0.31.0
getstorybook 1.6.1

@thani-sh
Copy link
Contributor

thani-sh commented Oct 31, 2016

Can you try forwarding that port

adb reverse tcp:7007 tcp:7007

@tracyxiong1
Copy link
Author

@mnmtanish Cool! It looks like it's going to work, but why do I have to do it? Is this a bug of Android?

@thani-sh
Copy link
Contributor

thani-sh commented Nov 1, 2016

It happens because localhost in the android device does not point to the host machine. This command will tunnel data from Android device to host machine for that port. The iOS simulator does this automatically

@thani-sh thani-sh closed this as completed Nov 8, 2016
@Kishanjvaghela
Copy link

@mnmtanish adb reverse was introduced in Android 5.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants