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

[Cordova] Cordova + Phonegap TCP Transport #89

Closed
victorb opened this issue May 3, 2017 · 6 comments
Closed

[Cordova] Cordova + Phonegap TCP Transport #89

victorb opened this issue May 3, 2017 · 6 comments
Labels
exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature kind/stale status/deferred Conscious decision to pause or backlog

Comments

@victorb
Copy link
Member

victorb commented May 3, 2017

In the browser, we don't have access to TCP Sockets as we do with nodejs. However, when in cordova/phonegap environment, you have access to a webview for running JS but also a plugin architecture, where you can expose native functionality as a JS API. Hence, there could be a transport written for cordova/phonegap in Android/iOS that enables us to have a nodejs-like js-ipfs instance in a webview.

This would help with developing mobile applications for JS developers.

There are some prior art with this as well, https://www.npmjs.com/package/cordova-plugin-chrome-apps-sockets-tcp comes from Google and exposes a sockets API whose interface can be seen here: https://developer.chrome.com/apps/sockets_tcp

There is also https://github.com/blocshop/sockets-for-cordova

Ideally, the interface exposed by the plugin would be identical to the nodejs interface for sockets, and then https://github.com/libp2p/js-libp2p-tcp could be easily adapted to work.

Existing, similar issues:

@victorb victorb changed the title Cordova TCP Transport Cordova/Phonegap TCP Transport May 3, 2017
@dryajov
Copy link
Member

dryajov commented May 3, 2017

Seems like the APIs are quite different among those plugins and the on that js-libp2p-tcp uses -which is Node's. We can either write a new transport specific for cordova or shim the node api on top of one of those plugins.

@dryajov
Copy link
Member

dryajov commented May 6, 2017

Looks like there is a node api plugin for cordova already - https://github.com/feross/chrome-net :)

@xSkyripper

@daviddias
Copy link
Member

That chrome net is a great find @dryajov. We can actually enable js-ipfs to just take in a whole custom libp2p instance so that runtimes like Cordoba can use the caps they have.

@xSkyripper, how does that sound? This shouldn't be hard to make it happen.

@daviddias daviddias added kind/enhancement A net-new feature or improvement to an existing feature exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue labels Jul 3, 2017
@daviddias daviddias changed the title Cordova/Phonegap TCP Transport [Cordova] Cordova/Phonegap TCP Transport Jul 7, 2017
@daviddias daviddias changed the title [Cordova] Cordova/Phonegap TCP Transport [Cordova] CordovaPhonegap TCP Transport Jul 9, 2017
@daviddias daviddias changed the title [Cordova] CordovaPhonegap TCP Transport [Cordova] Cordova + Phonegap TCP Transport Jul 9, 2017
@daviddias daviddias added the status/deferred Conscious decision to pause or backlog label Jul 27, 2017
@jayarjo
Copy link

jayarjo commented Apr 3, 2019

Is this still actual? I'd like to familiarize myself with the whole thing on a deeper level and looking for an entry point. I could try to implement this one.

@jacobheun
Copy link
Contributor

Having bridges for native transport and peer discovery support would be great, there still currently isn't any. While there are jvm and swift implementations of libp2p in early phases, there would still need to be bridges built for things like Cordova / React Native.

In theory we should be able to use websockets to run things in a browser build, although I don't believe that's been tested in Cordova. @jayarjo if you'd like to look into getting libp2p running in a mobile build that would be a nice tool for mobile app development.

I think starting with a browser build of libp2p and integrating in native components as needed, or to enhance the experience would be a good path.

jacobheun pushed a commit to jacobheun/js-libp2p that referenced this issue Jul 29, 2019
@p-shahi
Copy link
Member

p-shahi commented May 30, 2023

This would help with developing mobile applications for JS developers.

For now, you can use WebRTC or WebSocket on mobile devices. We're not officially supporting Cordova anytime soon (if community members want to hack it to work, we're happy to review PRs/provide assistance.)

@p-shahi p-shahi closed this as completed May 30, 2023
maschad pushed a commit to maschad/js-libp2p that referenced this issue Jun 21, 2023
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alex Potsides <alex@achingbrain.net>
maschad pushed a commit to maschad/js-libp2p that referenced this issue Jun 21, 2023
## [3.0.10](libp2p/js-libp2p-utils@v3.0.9...v3.0.10) (2023-04-18)

### Dependencies

* bump it-stream-types from 1.0.5 to 2.0.1 ([libp2p#89](libp2p/js-libp2p-utils#89)) ([0de4a85](libp2p/js-libp2p-utils@0de4a85))
maschad pushed a commit to maschad/js-libp2p that referenced this issue Jun 21, 2023
Bumps [p-event](https://github.com/sindresorhus/p-event) from 5.0.1 to 6.0.0.
- [Release notes](https://github.com/sindresorhus/p-event/releases)
- [Commits](sindresorhus/p-event@v5.0.1...v6.0.0)

---
updated-dependencies:
- dependency-name: p-event
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
maschad pushed a commit to maschad/js-libp2p that referenced this issue Jun 21, 2023
## [8.2.1](libp2p/js-libp2p-peer-store@v8.2.0...v8.2.1) (2023-06-15)

### Trivial Changes

* Update .github/workflows/semantic-pull-request.yml [skip ci] ([d38eaf8](libp2p/js-libp2p-peer-store@d38eaf8))
* Update .github/workflows/stale.yml [skip ci] ([9fe80a2](libp2p/js-libp2p-peer-store@9fe80a2))

### Dependencies

* **dev:** bump p-event from 5.0.1 to 6.0.0 ([libp2p#89](libp2p/js-libp2p-peer-store#89)) ([9d96700](libp2p/js-libp2p-peer-store@9d96700))
achingbrain pushed a commit that referenced this issue Jun 27, 2023
BREAKING CHANGE: messages are not self emitted by default anymore. You need to set the emitSelf option to true to use it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature kind/stale status/deferred Conscious decision to pause or backlog
Projects
None yet
Development

No branches or pull requests

6 participants