square / PonyDebugger

Remote network and data debugging for your native iOS app using Chrome Developer Tools
Other
5.86k stars 595 forks source link

Use separate front-end like Chrome DevTools app, instead of including own #135

Open auchenberg opened 9 years ago

auchenberg commented 9 years ago

I just released Chrome DevTools App, which is a standalone version of Chrome DevTools, independent of Chrome.

Intro

I imagine we could make it possible for PonyDebugger to use Chrome DevTools app, as the front-end instead of hosting it's own version?

We could also explore how to make the PonyDebugger endpoint discoverable by Chrome DevTools App, as I understand PonyDebugger already is using mDNS for endpoint discoverability, right?

How about that?

--- Want to back this issue? **[Place a bounty on it!](https://www.bountysource.com/issues/7322808-use-separate-front-end-like-chrome-devtools-app-instead-of-including-own?utm_campaign=plugin&utm_content=tracker%2F195817&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F195817&utm_medium=issues&utm_source=github).
derimagia commented 8 years ago

I've been researching this some to see how doable it is.

It would be really cool if we could get it so that the python "ponyd" application wasn't needed. Right now it pretty much just links the iOS App and the Developer Tools, acting kind of like a man-in-the-middle. To do this we would need to somehow implement something in Chrome DevTools to take care of it. Maybe we implement the mDNS in the Chrome Dev tools? It would be nice if there was some type of standard.

The JSON endpoints chrome gives are nice, but it doesn't really work when we are connecting to an IOS device since it doesn't really have a ip/port.

auchenberg commented 8 years ago

Indeed. For now we would need ponyd to act as an "protocol adaptor" between iOS and Chrome DevTools. I already done some experimentation with mDNS for node-inspector where the device is announced over MDNS. See here https://github.com/node-inspector/node-inspector/pull/515

I think the MDNS meta-data could be much simpler with a device name, device type, and a URL to the JSON-endpoint, which a given client then can fetch and extract. This way we wouldn't leak data over MDNS and we could add some auth on the JSON endpoint, if needed.

Thoughts?

derimagia commented 8 years ago

Sounds good. I'll see if I can make PonyDebugger / ponyd give a JSON endpoint.

I see that you did the work with node-inspector so it exposes the JSON endpoint over MDNS

Have you done any work to have Chrome DevTools app to consume these separate endpoints in a fluid way?

auchenberg commented 8 years ago

That be really cool! A JSON endpoint could potentially make it work with https://devtoolsremote.com too.

Yup, there's a branch where a crude MDNS discoverer is implemented. Here's the commit https://github.com/auchenberg/chrome-devtools-app/commit/8429c4b9623f5afcc835d60fe05dee97154b9f4b

auchenberg commented 8 years ago

The Chrome HTTP/JSON interface is somewhat documented here https://github.com/buggerjs/bugger-daemon#api

auchenberg commented 8 years ago

@Derimagia I did a rough draft of a potential mDNS spec: https://github.com/RemoteDebug/remotedebug-mdns-spec

Thoughts?

derimagia commented 8 years ago

Very nice. Thanks for drafting that. I'll try to take a look at this this weekend.

I've been slightly avoiding doing it because there are a lot of issues with pybonjour in this project so far that haven't been fixed in months which makes it difficult to event get the python app running on macs, but I'll see what I can do.

auchenberg commented 8 years ago

Alrighty, that sounds a bit more important then this experiment, so no rush :)