bitcore-p2p
bitcore-p2p copied to clipboard
Support FirefoxOS & ChromeOS TCP Sockets
Add integrated support for TCP sockets available in FirefoxOS and ChromeOS:
- https://developer.mozilla.org/en-US/docs/Web/API/TCP_Socket_API
- https://developer.chrome.com/apps/sockets_tcp
Currently possible using "webpack" and "chrome-net" as demonstrated by @throughnothing: https://github.com/bitpay/bitcore-p2p/issues/21#issuecomment-74369533
To be clear, my demonstration won't work on a web page in Chrome, as the sockets API (that I'm using at least) is only available to Chrome apps/extensions. To do it from a normal webpage in the browser, I presume we'd have to use WebRTC or WebSockets, or something similar. WebTorrent may be something worth looking at, as it is a peer-to-peer bit-torrent client that can run in the browser using WebRTC for p2p communication.
Yep, the TCP sockets available in apps and extensions can directly connect to any Bitcoin node, and hybrid nodes are not needed as in the case of WebSocket/WebRTC.