Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugger failed with web socket error when running a real device #148

Open
yiplee opened this issue Apr 15, 2015 · 7 comments
Open

Debugger failed with web socket error when running a real device #148

yiplee opened this issue Apr 15, 2015 · 7 comments
Labels
websockets Issues affecting the websockets communication layer

Comments

@yiplee
Copy link

yiplee commented Apr 15, 2015

here is the code

PDDebugger *debugger = [PDDebugger defaultInstance];

  [debugger enableNetworkTrafficDebugging];
  [debugger forwardAllNetworkTraffic];

  [debugger enableCoreDataDebugging];
  [debugger addManagedObjectContext:[NSManagedObjectContext MR_defaultContext] withName:@"Main MOC"];
  [debugger addManagedObjectContext:[NSManagedObjectContext MR_rootSavingContext] withName:@"Root MOC"];

  [debugger enableViewHierarchyDebugging];
  [debugger setDisplayedViewAttributeKeyPaths:@[@"frame", @"hidden", @"alpha", @"opaque"]];

#if !TARGET_IPHONE_SIMULATOR
 [debugger autoConnect];
#else
  [debugger connectToURL:[NSURL URLWithString:@"ws://localhost:9000/device"]];
#endif

here is the log
screen shot 2015-04-15 at 09 19 13

BTW , it works well on a simulator .

@wlue
Copy link
Contributor

wlue commented Apr 17, 2015

How are you running ponyd? If you want it to listen to connections outside of your computer, make sure you run ponyd with -i 0.0.0.0

@yiplee
Copy link
Author

yiplee commented Apr 18, 2015

@wlue Thanks for your reply . I have tried -i 0.0.0.0 but failed with response code 403 when conecting .

screen shot 2015-04-18 at 12 39 53

@JonathanBouaziz
Copy link

Did you ever resolve the issue @yiplee ?

@Nadzeya-Zomato
Copy link

Hi, guys! Did you solve this issue? @yiplee @JonathanBouaziz?
I've faced with the same problem.
I've solved it in this way. Instead of [debugger connectToURL:[NSURL URLWithString:@"ws://localhost:9000/device"]];
Put your real IP-address. Smth like:

PDDebugger *debugger = [PDDebugger defaultInstance];
[debugger connectToURL:[NSURL URLWithString:@"ws://10.0.2.120:9000/device"]];

@gruhls508
Copy link

@Nadzeya-Zomato what do you mean by "your real IP-address?" Might be a noob thing to ask, but would this be the IP address for local-host? I'm not too versed in web/server things

@dstd
Copy link

dstd commented Jan 17, 2016

@gruhls508 as the subject says it's all about app running on real device. So if you use localhost as the address in connectToURL, then your app will try to find the PD server (ponyd) on the iPhone. That's why you have to specify address of your Mac, where ponyd is running.

So:

  1. use 0.0.0.0 address for ponyd (ponyd serve -i 0.0.0.0)
  2. use IP of your Mac in connectToURL (⌥+click on Wi-Fi icon to get your Mac's IP address)

@gruhls508
Copy link

Ok that makes sense. Thanks @dstd

@asmallteapot asmallteapot added the websockets Issues affecting the websockets communication layer label Jul 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
websockets Issues affecting the websockets communication layer
Projects
None yet
Development

No branches or pull requests

7 participants