Giter Club home page Giter Club logo

js-libp2p-websockets's Introduction

libp2p is a modular networking framework bundled together as a full stack of protocols for peer-to-peer systems. It is the product of a long and arduous quest into the internet's network stack and all of the plentiful peer-to-peer protocols of the past. Building large-scale peer-to-peer systems has been complex and challenging in the last twenty years and libp2p is a way to fix that. It is a "network stack"β€”a protocol suiteβ€”that cleanly separates concerns and enables sophisticated applications to use only the protocols they need without giving up interoperability and upgradeability. libp2p grew out of IPFS into an independent project designed to give any project state-of-the-art peer-to-peer capabilities.

Learn more about libp2p at libp2p.io and docs.libp2p.io.

Specifications

View the formal specifications of libp2p on the specifications repository.

Implementations

Follow the latest libp2p implementations at libp2p.io/implementations.

Dormant Implementation Projects

The following are implementation projects that have fallen dormant and we would love to help volunteers revive them. If you're interested, please reach out on any of our forums or chat rooms and we can help you start where the previous maintainers left off.

Community

Announcements

For all libp2p community announcements look for posts under the "News" topic in the community-wide forums or tagged as an announcement in the technical discussion forums and chat channels listed below.

Blog

The libp2p community blog can be read at blog.libp2p.io. If you would like to write a blog post about your cool project that uses libp2p, you can either post a message in this project's discussion forum or you may post a message in our community-wide discussion forums at discuss.libp2p.io. If you tag either @p-shahi or @dhuseby in your post we'll get back to you ASAP about your post.

Calendar

If you're a libp2p implementer, consumer, or user you are welcome to join the community meetings we host regularly. Stay up to date by following the libp2p community calendar on Lu.ma (add it to your calendar with this iCal feed).

Discussion

Please visit our community-wide discussion forums at discuss.libp2p.io to discussion community events such as hackathons and conferences and to ask questions about the past, present, and future of libp2p, and more.

If you are looking for technical help about a specific libp2p implementation, you may ask in the discussion forums on each of the implementation's Github Discusssions Forum. Here's the list of links to their technical discussion forums for each implementation listed above:

Chat

Events

Throughout the year, the libp2p community participates in a number of hackathons and we send speakers to community conferences such as EthGlobal all around the world. If you are interested in participating, keep an eye on the community calendar and announcements to learn about when and how you can get involved.

js-libp2p-websockets's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

js-libp2p-websockets's Issues

Cannot dial localhost peer over unsecured ws multiaddress

I am trying to dial a local service running on localhost from the browser over a websocket with a multiaddress like /ip4/127.0.0.1/tcp/8000/ws/p2p/QmQpHnb8k5gVze8PgqFZANMUf57apCWPjQihrXV53dkF2W but this address is filtered by src/filters.js:

dnsWss: (multiaddrs) => multiaddrs.filter((ma) => {
    if (ma.protoCodes().includes(CODE_CIRCUIT)) {
      return false
    }

    const testMa = ma.decapsulateCode(CODE_P2P)

    return mafmt.WebSocketsSecure.matches(testMa) &&
      mafmt.DNS.matches(testMa.decapsulateCode(CODE_TCP).decapsulateCode(CODE_WSS))
  }),

I understand the intent here for dialing public addresses over secure websockets but it seems like within a host that it should be supported to dial without wss. Thoughts?

An in-range update of multiaddr is breaking the build 🚨

Version 2.2.3 of multiaddr just got published.

Branch Build failing 🚨
Dependency multiaddr
Current Version 2.2.2
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As multiaddr is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build is in progress Details

  • ❌ ci/circleci Your tests failed on CircleCI Details

Commits

The new version differs by 5 commits .

  • d632745 chore: release version v2.2.3
  • 1939b35 chore: update contributors
  • cbfcbdb chore: update deps
  • 08d5d5d [WIP] feat: adding p2p-circuit proto (#41)
  • e7e53b9 test: use dirty-chai

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Transport filters and `dnsaddr`

We started using the dnsaddr feature and I was wondering how I can be combine that with the filter implementations
as defined in the websocket examples (code)

I was unable to use the dnsWsOrWss filter in combination with our dnsaddr entries and was wondering why. Our TXT entries resolve to the IP address, potentially this is the problem. But I would have expected the filter to be valid for dnsaddr as well.
Since we cannot use dnsWsOrWss we are using all for now, and in case we dial an unsupported transport address we just log a warning. Non-websocket transports may be dialed if the websocket connection runs into some error. This would not happen if we could use the filter.

I was wondering how this filter feature was meant to be used. I thought about adding an ipWsOrWss filter, or extend the dns part of the filter to accept dnsaddr (not sure if that can be achieved easily). But I am not sure that this goes towards the idea of how this was meant to be used so it would be great to get some input!

An in-range update of interface-transport is breaking the build 🚨

Version 0.3.5 of interface-transport just got published.

Branch Build failing 🚨
Dependency interface-transport
Current Version 0.3.4
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As interface-transport is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ ci/circleci Your tests failed on CircleCI Details

  • ❌ continuous-integration/travis-ci/push The Travis CI build is in progress Details

Commits

The new version differs by 8 commits .

  • d4ee2a3 chore: release version v0.3.5
  • 131f06c chore: update contributors
  • 9a993ea chore: update package.json
  • 3f83a4a chore: update aegir
  • 5699681 Merge pull request #23 from dryajov/master
  • 54b83a7 fix: wrong main path in package.json
  • 4732225 Merge pull request #22 from libp2p/greenkeeper-aegir-10.0.0
  • 5cb8c44 chore(package): update aegir to version 10.0.0

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

ipv6 tests

Currently, travis has unreliable support for ipv6.

The tests for ipv6 are skipped now and we should target finding out a solution to re-enable them.

Socket close handler not working in browser setting

Hey, I noticed the socket close handler is not working in the browser

stream.socket.once != null && stream.socket.once('close', () => { // eslint-disable-line @typescript-eslint/prefer-optional-chain
// In instances where `close` was not explicitly called,
// such as an iterable stream ending, ensure we have set the close
// timeline
if (maConn.timeline.close == null) {
maConn.timeline.close = Date.now()
}
})
. To verify I have locally edited socket-to-conn.js and replaced the .once stuff with this:

function onclose () {
    if (stream.socket.onclose === onclose) {
        stream.socket.onclose = null; // only once
    }
    if (maConn.timeline.close == null) {
        maConn.timeline.close = Date.now();
    }
}
stream.socket.onclose = onclose;

It has the downside of mutating the object so there might be a better solution, but it works.

Potential memory leak

The trackConn function in the listener stores each maConn in the __connections array on the server, in order to close them when the listener is closed.

close is an async method so there could be an unhandledPromiseRejection here, but that's a separate issue.

It doesn't ever seem to remove them from the array. We should be working out if the MaConn is closed at any point - then we can remove them from the list since it won't be necessary to close them when the listener is stopped.

Passing Strings instead of Buffers

Got this while testing WebSockets with go-ipfs

Debug: internal, implementation, error
    Error: Uncaught error: data must be a buffer, was: "\u0013/multistream/1.0.0\n"
    at Object.add (/Users/david/code/js-ipfs/node_modules/pull-reader/state.js:18:15)
    at /Users/david/code/js-ipfs/node_modules/pull-reader/index.js:61:15
    at /Users/david/code/js-ipfs/node_modules/pull-reader/index.js:20:7
    at WebSocket.<anonymous> (/Users/david/code/js-ipfs/node_modules/pull-ws/source.js:23:14)
    at WebSocket.onMessage (/Users/david/code/js-ipfs/node_modules/ws/lib/WebSocket.js:442:14)

Cannot catch EADDRINUSE

Hello! I want to implement that a different port is tried automatically when the currently tried out port is in use. However, it is impossible to catch the EADDRINUSE exception when running await node.start();. NodeJS terminates before node.start() returns a Promise.

Following is output:

node:events:491
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE: address already in use :::8000
    at Server.setupListenHandle [as _listen2] (node:net:1485:16)
    at listenInCluster (node:net:1533:12)
    at Server.listen (node:net:1621:7)
    at file:///project/node_modules/it-ws/dist/src/server.js:14:25
    at new Promise (<anonymous>)
    at Server.listen (file:///project/node_modules/it-ws/dist/src/server.js:12:22)
    at WebSocketListener.listen (file:///project/node_modules/@libp2p/websockets/dist/src/listener.js:72:27)
    at DefaultTransportManager.listen (file:///project/node_modules/libp2p/dist/src/transport-manager.js:155:37)
    at DefaultTransportManager.start (file:///project/node_modules/libp2p/dist/src/transport-manager.js:44:20)
    at file:///project/node_modules/@libp2p/components/dist/src/index.js:67:29
Emitted 'error' event on WebSocketServer instance at:
    at Server.emit (node:events:513:28)
    at emitErrorNT (node:net:1512:8)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: 'EADDRINUSE',
  errno: -98,
  syscall: 'listen',
  address: '::',
  port: 8000
}

Node.js v18.9.0

To me, the issue has a medium severity, because the workaround to check the port usage before is tedious, platform dependent, and cannot be reliable because it is not atomic.

Versions:

  • Node.js: 18.9.0
  • libp2p: 0.39.1
  • @libp2p/websockets: 3.0.3

Possibly related:

Better browser error handling when dial fails

When not passing any filter in the browser, I understand that filter dnsWsOrWss is being used.
When trying to connect to an ip4 ws address, it fails due to the filter, however the error returned by libp2p is very obscure (see below).

Would there be a way to make this error point to the filter instead?

libp2p:dialer:err AggregateError@http://localhost:3000/static/js/vendors~main.chunk.js:1284:5
maybeSettle@http://localhost:3000/static/js/vendors~main.chunk.js:104218:14
pSome/</<@http://localhost:3000/static/js/vendors~main.chunk.js:104256:27
async*pSome/<@http://localhost:3000/static/js/vendors~main.chunk.js:104260:7
PCancelable/this._promise<@http://localhost:3000/static/js/vendors~main.chunk.js:104342:14
PCancelable@http://localhost:3000/static/js/vendors~main.chunk.js:104313:21
pSome@http://localhost:3000/static/js/vendors~main.chunk.js:104194:38
../node_modules/p-any/index.js/module.exports@http://localhost:3000/static/js/vendors~main.chunk.js:103726:30
run@http://localhost:3000/static/js/vendors~main.chunk.js:58575:20
_createPendingDial@http://localhost:3000/static/js/vendors~main.chunk.js:58849:28
connectToPeer@http://localhost:3000/static/js/vendors~main.chunk.js:58754:71
async*_maybeConnect@http://localhost:3000/static/js/vendors~main.chunk.js:60533:29
_onDidStart/<@http://localhost:3000/static/js/vendors~main.chunk.js:60481:12
emit@http://localhost:3000/static/js/vendors~main.chunk.js:158572:17
add@http://localhost:3000/static/js/vendors~main.chunk.js:62771:16
_createDialTarget@http://localhost:3000/static/js/vendors~main.chunk.js:58790:34
connectToPeer@http://localhost:3000/static/js/vendors~main.chunk.js:58748:35
_dial@http://localhost:3000/static/js/vendors~main.chunk.js:60336:38
dialProtocol@http://localhost:3000/static/js/vendors~main.chunk.js:60312:35
dial@http://localhost:3000/static/js/main.chunk.js:224:23
initWaku@http://localhost:3000/static/js/main.chunk.js:3595:22
async*App/<@http://localhost:3000/static/js/main.chunk.js:3606:7
invokePassiveEffectCreate@http://localhost:3000/static/js/vendors~main.chunk.js:190984:24
callCallback@http://localhost:3000/static/js/vendors~main.chunk.js:171600:18
invokeGuardedCallbackDev@http://localhost:3000/static/js/vendors~main.chunk.js:171649:20
invokeGuardedCallback@http://localhost:3000/static/js/vendors~main.chunk.js:171709:35
flushPassiveEffectsImpl@http://localhost:3000/static/js/vendors~main.chunk.js:191066:34
unstable_runWithPriority@http://localhost:3000/static/js/vendors~main.chunk.js:203136:16
runWithPriority$1@http://localhost:3000/static/js/vendors~main.chunk.js:179006:14
flushPassiveEffects@http://localhost:3000/static/js/vendors~main.chunk.js:190943:18
commitBeforeMutationEffects/<@http://localhost:3000/static/js/vendors~main.chunk.js:190824:15
workLoop@http://localhost:3000/static/js/vendors~main.chunk.js:203086:46
flushWork@http://localhost:3000/static/js/vendors~main.chunk.js:203060:18
performWorkUntilDeadline@http://localhost:3000/static/js/vendors~main.chunk.js:202826:52
EventHandlerNonNull*./node_modules/scheduler/cjs/scheduler.development.js/<@http://localhost:3000/static/js/vendors~main.chunk.js:202850:7
./node_modules/scheduler/cjs/scheduler.development.js@http://localhost:3000/static/js/vendors~main.chunk.js:203306:5
__webpack_require__@http://localhost:3000/static/js/bundle.js:852:31
fn@http://localhost:3000/static/js/bundle.js:151:20
./node_modules/scheduler/index.js@http://localhost:3000/static/js/vendors~main.chunk.js:203322:20
__webpack_require__@http://localhost:3000/static/js/bundle.js:852:31
fn@http://localhost:3000/static/js/bundle.js:151:20
./node_modules/react-dom/cjs/react-dom.development.js/<@http://localhost:3000/static/js/vendors~main.chunk.js:167700:40
./node_modules/react-dom/cjs/react-dom.development.js@http://localhost:3000/static/js/vendors~main.chunk.js:193696:5
__webpack_require__@http://localhost:3000/static/js/bundle.js:852:31
fn@http://localhost:3000/static/js/bundle.js:151:20
./node_modules/react-dom/index.js@http://localhost:3000/static/js/vendors~main.chunk.js:193739:20
__webpack_require__@http://localhost:3000/static/js/bundle.js:852:31
fn@http://localhost:3000/static/js/bundle.js:151:20
./src/index.tsx/<@http://localhost:3000/static/js/main.chunk.js:4473:86
./src/index.tsx@http://localhost:3000/static/js/main.chunk.js:4574:30
__webpack_require__@http://localhost:3000/static/js/bundle.js:852:31
fn@http://localhost:3000/static/js/bundle.js:151:20
1@http://localhost:3000/static/js/main.chunk.js:4588:18
__webpack_require__@http://localhost:3000/static/js/bundle.js:852:31
checkDeferredModules@http://localhost:3000/static/js/bundle.js:46:23
webpackJsonpCallback@http://localhost:3000/static/js/bundle.js:33:19
@http://localhost:3000/static/js/main.chunk.js:1:69
 +0ms common.js:111
libp2p:dialer:err AggregateError@http://localhost:3000/static/js/vendors~main.chunk.js:1284:5
maybeSettle@http://localhost:3000/static/js/vendors~main.chunk.js:104218:14
pSome/</<@http://localhost:3000/static/js/vendors~main.chunk.js:104256:27
async*pSome/<@http://localhost:3000/static/js/vendors~main.chunk.js:104260:7
PCancelable/this._promise<@http://localhost:3000/static/js/vendors~main.chunk.js:104342:14
PCancelable@http://localhost:3000/static/js/vendors~main.chunk.js:104313:21
pSome@http://localhost:3000/static/js/vendors~main.chunk.js:104194:38
../node_modules/p-any/index.js/module.exports@http://localhost:3000/static/js/vendors~main.chunk.js:103726:30
run@http://localhost:3000/static/js/vendors~main.chunk.js:58575:20
_createPendingDial@http://localhost:3000/static/js/vendors~main.chunk.js:58849:28
connectToPeer@http://localhost:3000/static/js/vendors~main.chunk.js:58754:71
async*_maybeConnect@http://localhost:3000/static/js/vendors~main.chunk.js:60533:29
_onDidStart/<@http://localhost:3000/static/js/vendors~main.chunk.js:60481:12
emit@http://localhost:3000/static/js/vendors~main.chunk.js:158572:17
add@http://localhost:3000/static/js/vendors~main.chunk.js:62771:16
_createDialTarget@http://localhost:3000/static/js/vendors~main.chunk.js:58790:34
connectToPeer@http://localhost:3000/static/js/vendors~main.chunk.js:58748:35
_dial@http://localhost:3000/static/js/vendors~main.chunk.js:60336:38
dialProtocol@http://localhost:3000/static/js/vendors~main.chunk.js:60312:35
dial@http://localhost:3000/static/js/main.chunk.js:224:23
initWaku@http://localhost:3000/static/js/main.chunk.js:3595:22
async*App/<@http://localhost:3000/static/js/main.chunk.js:3606:7
invokePassiveEffectCreate@http://localhost:3000/static/js/vendors~main.chunk.js:190984:24
callCallback@http://localhost:3000/static/js/vendors~main.chunk.js:171600:18
invokeGuardedCallbackDev@http://localhost:3000/static/js/vendors~main.chunk.js:171649:20
invokeGuardedCallback@http://localhost:3000/static/js/vendors~main.chunk.js:171709:35
flushPassiveEffectsImpl@http://localhost:3000/static/js/vendors~main.chunk.js:191066:34
unstable_runWithPriority@http://localhost:3000/static/js/vendors~main.chunk.js:203136:16
runWithPriority$1@http://localhost:3000/static/js/vendors~main.chunk.js:179006:14
flushPassiveEffects@http://localhost:3000/static/js/vendors~main.chunk.js:190943:18
commitBeforeMutationEffects/<@http://localhost:3000/static/js/vendors~main.chunk.js:190824:15
workLoop@http://localhost:3000/static/js/vendors~main.chunk.js:203086:46
flushWork@http://localhost:3000/static/js/vendors~main.chunk.js:203060:18
performWorkUntilDeadline@http://localhost:3000/static/js/vendors~main.chunk.js:202826:52
EventHandlerNonNull*./node_modules/scheduler/cjs/scheduler.development.js/<@http://localhost:3000/static/js/vendors~main.chunk.js:202850:7
./node_modules/scheduler/cjs/scheduler.development.js@http://localhost:3000/static/js/vendors~main.chunk.js:203306:5
__webpack_require__@http://localhost:3000/static/js/bundle.js:852:31
fn@http://localhost:3000/static/js/bundle.js:151:20
./node_modules/scheduler/index.js@http://localhost:3000/static/js/vendors~main.chunk.js:203322:20
__webpack_require__@http://localhost:3000/static/js/bundle.js:852:31
fn@http://localhost:3000/static/js/bundle.js:151:20
./node_modules/react-dom/cjs/react-dom.development.js/<@http://localhost:3000/static/js/vendors~main.chunk.js:167700:40
./node_modules/react-dom/cjs/react-dom.development.js@http://localhost:3000/static/js/vendors~main.chunk.js:193696:5
__webpack_require__@http://localhost:3000/static/js/bundle.js:852:31
fn@http://localhost:3000/static/js/bundle.js:151:20
./node_modules/react-dom/index.js@http://localhost:3000/static/js/vendors~main.chunk.js:193739:20
__webpack_require__@http://localhost:3000/static/js/bundle.js:852:31
fn@http://localhost:3000/static/js/bundle.js:151:20
./src/index.tsx/<@http://localhost:3000/static/js/main.chunk.js:4473:86
./src/index.tsx@http://localhost:3000/static/js/main.chunk.js:4574:30
__webpack_require__@http://localhost:3000/static/js/bundle.js:852:31
fn@http://localhost:3000/static/js/bundle.js:151:20
1@http://localhost:3000/static/js/main.chunk.js:4588:18
__webpack_require__@http://localhost:3000/static/js/bundle.js:852:31
checkDeferredModules@http://localhost:3000/static/js/bundle.js:46:23
webpackJsonpCallback@http://localhost:3000/static/js/bundle.js:33:19
@http://localhost:3000/static/js/main.chunk.js:1:69
 +1ms common.js:111
libp2p:err could not connect to discovered peer +0ms AggregateError: 
    dial@http://localhost:3000/static/js/vendors~main.chunk.js:66377:21
    dialAction@http://localhost:3000/static/js/vendors~main.chunk.js:58833:36
    run/<@http://localhost:3000/static/js/vendors~main.chunk.js:58582:29
    Async*run@http://localhost:3000/static/js/vendors~main.chunk.js:58575:36
    _createPendingDial@http://localhost:3000/static/js/vendors~main.chunk.js:58849:28
    connectToPeer@http://localhost:3000/static/js/vendors~main.chunk.js:58754:71
    async*_maybeConnect@http://localhost:3000/static/js/vendors~main.chunk.js:60533:29
    _onDidStart/<@http://localhost:3000/static/js/vendors~main.chunk.js:60481:12
    emit@http://localhost:3000/static/js/vendors~main.chunk.js:158572:17
    add@http://localhost:3000/static/js/vendors~main.chunk.js:62771:16
    _createDialTarget@http://localhost:3000/static/js/vendors~main.chunk.js:58790:34
    connectToPeer@http://localhost:3000/static/js/vendors~main.chunk.js:58748:35
    _dial@http://localhost:3000/static/js/vendors~main.chunk.js:60336:38
    dialProtocol@http://localhost:3000/static/js/vendors~main.chunk.js:60312:35
    dial@http://localhost:3000/static/js/main.chunk.js:224:23
    initWaku@http://localhost:3000/static/js/main.chunk.js:3595:22
    async*App/<@http://localhost:3000/static/js/main.chunk.js:3606:7
    invokePassiveEffectCreate@http://localhost:3000/static/js/vendors~main.chunk.js:190984:24
    callCallback@http://localhost:3000/static/js/vendors~main.chunk.js:171600:18
    invokeGuardedCallbackDev@http://localhost:3000/static/js/vendors~main.chunk.js:171649:20
    invokeGuardedCallback@http://localhost:3000/static/js/vendors~main.chunk.js:171709:35
    flushPassiveEffectsImpl@http://localhost:3000/static/js/vendors~main.chunk.js:191066:34
    unstable_runWithPriority@http://localhost:3000/static/js/vendors~main.chunk.js:203136:16
    runWithPriority$1@http://localhost:3000/static/js/vendors~main.chunk.js:179006:14
    flushPassiveEffects@http://localhost:3000/static/js/vendors~main.chunk.js:190943:18
    commitBeforeMutationEffects/<@http://localhost:3000/static/js/vendors~main.chunk.js:190824:15
    workLoop@http://localhost:3000/static/js/vendors~main.chunk.js:203086:46
    flushWork@http://localhost:3000/static/js/vendors~main.chunk.js:203060:18
    performWorkUntilDeadline@http://localhost:3000/static/js/vendors~main.chunk.js:202826:52
    EventHandlerNonNull*./node_modules/scheduler/cjs/scheduler.development.js/<@http://localhost:3000/static/js/vendors~main.chunk.js:202850:7
    ./node_modules/scheduler/cjs/scheduler.development.js@http://localhost:3000/static/js/vendors~main.chunk.js:203306:5
    __webpack_require__@http://localhost:3000/static/js/bundle.js:852:31
    fn@http://localhost:3000/static/js/bundle.js:151:20
    ./node_modules/scheduler/index.js@http://localhost:3000/static/js/vendors~main.chunk.js:203322:20
    __webpack_require__@http://localhost:3000/static/js/bundle.js:852:31
    fn@http://localhost:3000/static/js/bundle.js:151:20
    ./node_modules/react-dom/cjs/react-dom.development.js/<@http://localhost:3000/static/js/vendors~main.chunk.js:167700:40
    ./node_modules/react-dom/cjs/react-dom.development.js@http://localhost:3000/static/js/vendors~main.chunk.js:193696:5
    __webpack_require__@http://localhost:3000/static/js/bundle.js:852:31
    fn@http://localhost:3000/static/js/bundle.js:151:20
    ./node_modules/react-dom/index.js@http://localhost:3000/static/js/vendors~main.chunk.js:193739:20
    __webpack_require__@http://localhost:3000/static/js/bundle.js:852:31
    fn@http://localhost:3000/static/js/bundle.js:151:20
    ./src/index.tsx/<@http://localhost:3000/static/js/main.chunk.js:4473:86
    ./src/index.tsx@http://localhost:3000/static/js/main.chunk.js:4574:30
    __webpack_require__@http://localhost:3000/static/js/bundle.js:852:31
    fn@http://localhost:3000/static/js/bundle.js:151:20
    1@http://localhost:3000/static/js/main.chunk.js:4588:18
    __webpack_require__@http://localhost:3000/static/js/bundle.js:852:31
    checkDeferredModules@http://localhost:3000/static/js/bundle.js:46:23
    webpackJsonpCallback@http://localhost:3000/static/js/bundle.js:33:19
    @http://localhost:3000/static/js/main.chunk.js:1:69
    AggregateError index.js:33
    maybeSettle index.js:31
    pSome index.js:69
    pSome index.js:73
    _promise index.js:61
    PCancelable index.js:31
    pSome index.js:7
    exports index.js:6
    run dial-request.js:67
    _createPendingDial index.js:205
    connectToPeer index.js:115
    _maybeConnect index.js:698
    _onDidStart index.js:646
    emit events.js:153
    add address-book.js:259
    _createDialTarget index.js:146
    connectToPeer index.js:110
    _dial index.js:500
    dialProtocol index.js:480
    dial waku.ts:87
    initWaku App.tsx:48
    App App.tsx:60
    React 5
    unstable_runWithPriority scheduler.development.js:468
    React 3
    workLoop scheduler.development.js:417
    flushWork scheduler.development.js:390
    performWorkUntilDeadline scheduler.development.js:157
    js scheduler.development.js:180
    js scheduler.development.js:645
    Webpack 21
common.js:111
Error when dialing peer  AggregateError: 
    dial@http://localhost:3000/static/js/vendors~main.chunk.js:66377:21
    dialAction@http://localhost:3000/static/js/vendors~main.chunk.js:58833:36
    run/<@http://localhost:3000/static/js/vendors~main.chunk.js:58582:29
    Async*run@http://localhost:3000/static/js/vendors~main.chunk.js:58575:36
    _createPendingDial@http://localhost:3000/static/js/vendors~main.chunk.js:58849:28
    connectToPeer@http://localhost:3000/static/js/vendors~main.chunk.js:58754:71
    async*_maybeConnect@http://localhost:3000/static/js/vendors~main.chunk.js:60533:29
    _onDidStart/<@http://localhost:3000/static/js/vendors~main.chunk.js:60481:12
    emit@http://localhost:3000/static/js/vendors~main.chunk.js:158572:17
    add@http://localhost:3000/static/js/vendors~main.chunk.js:62771:16
    _createDialTarget@http://localhost:3000/static/js/vendors~main.chunk.js:58790:34
    connectToPeer@http://localhost:3000/static/js/vendors~main.chunk.js:58748:35
    _dial@http://localhost:3000/static/js/vendors~main.chunk.js:60336:38
    dialProtocol@http://localhost:3000/static/js/vendors~main.chunk.js:60312:35
    dial@http://localhost:3000/static/js/main.chunk.js:224:23
    initWaku@http://localhost:3000/static/js/main.chunk.js:3595:22
    async*App/<@http://localhost:3000/static/js/main.chunk.js:3606:7
    invokePassiveEffectCreate@http://localhost:3000/static/js/vendors~main.chunk.js:190984:24
    callCallback@http://localhost:3000/static/js/vendors~main.chunk.js:171600:18
    invokeGuardedCallbackDev@http://localhost:3000/static/js/vendors~main.chunk.js:171649:20
    invokeGuardedCallback@http://localhost:3000/static/js/vendors~main.chunk.js:171709:35
    flushPassiveEffectsImpl@http://localhost:3000/static/js/vendors~main.chunk.js:191066:34
    unstable_runWithPriority@http://localhost:3000/static/js/vendors~main.chunk.js:203136:16
    runWithPriority$1@http://localhost:3000/static/js/vendors~main.chunk.js:179006:14
    flushPassiveEffects@http://localhost:3000/static/js/vendors~main.chunk.js:190943:18
    commitBeforeMutationEffects/<@http://localhost:3000/static/js/vendors~main.chunk.js:190824:15
    workLoop@http://localhost:3000/static/js/vendors~main.chunk.js:203086:46
    flushWork@http://localhost:3000/static/js/vendors~main.chunk.js:203060:18
    performWorkUntilDeadline@http://localhost:3000/static/js/vendors~main.chunk.js:202826:52
    EventHandlerNonNull*./node_modules/scheduler/cjs/scheduler.development.js/<@http://localhost:3000/static/js/vendors~main.chunk.js:202850:7
    ./node_modules/scheduler/cjs/scheduler.development.js@http://localhost:3000/static/js/vendors~main.chunk.js:203306:5
    __webpack_require__@http://localhost:3000/static/js/bundle.js:852:31
    fn@http://localhost:3000/static/js/bundle.js:151:20
    ./node_modules/scheduler/index.js@http://localhost:3000/static/js/vendors~main.chunk.js:203322:20
    __webpack_require__@http://localhost:3000/static/js/bundle.js:852:31
    fn@http://localhost:3000/static/js/bundle.js:151:20
    ./node_modules/react-dom/cjs/react-dom.development.js/<@http://localhost:3000/static/js/vendors~main.chunk.js:167700:40
    ./node_modules/react-dom/cjs/react-dom.development.js@http://localhost:3000/static/js/vendors~main.chunk.js:193696:5
    __webpack_require__@http://localhost:3000/static/js/bundle.js:852:31
    fn@http://localhost:3000/static/js/bundle.js:151:20
    ./node_modules/react-dom/index.js@http://localhost:3000/static/js/vendors~main.chunk.js:193739:20
    __webpack_require__@http://localhost:3000/static/js/bundle.js:852:31
    fn@http://localhost:3000/static/js/bundle.js:151:20
    ./src/index.tsx/<@http://localhost:3000/static/js/main.chunk.js:4473:86
    ./src/index.tsx@http://localhost:3000/static/js/main.chunk.js:4574:30
    __webpack_require__@http://localhost:3000/static/js/bundle.js:852:31
    fn@http://localhost:3000/static/js/bundle.js:151:20
    1@http://localhost:3000/static/js/main.chunk.js:4588:18
    __webpack_require__@http://localhost:3000/static/js/bundle.js:852:31
    checkDeferredModules@http://localhost:3000/static/js/bundle.js:46:23
    webpackJsonpCallback@http://localhost:3000/static/js/bundle.js:33:19
    @http://localhost:3000/static/js/main.chunk.js:1:69
    AggregateError index.js:33
    maybeSettle index.js:31
    pSome index.js:69
    pSome index.js:73
    _promise index.js:61
    PCancelable index.js:31
    pSome index.js:7
    exports index.js:6
    run dial-request.js:67
    _createPendingDial index.js:205
    connectToPeer index.js:115
    _maybeConnect index.js:698
    _onDidStart index.js:646
    emit events.js:153
    add address-book.js:259
    _createDialTarget index.js:146
    connectToPeer index.js:110
    _dial index.js:500
    dialProtocol index.js:480
    dial waku.ts:87
    initWaku App.tsx:48
    App App.tsx:60
    React 5
    unstable_runWithPriority scheduler.development.js:468
    React 3
    workLoop scheduler.development.js:417
    flushWork scheduler.development.js:390
    performWorkUntilDeadline scheduler.development.js:157
    js scheduler.development.js:180
    js scheduler.development.js:645
    Webpack 21

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you can benefit from your bug fixes and new features again.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can fix this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here are some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Invalid npm token.

The npm token configured in the NPM_TOKEN environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/.

If you are using Two Factor Authentication for your account, set its level to "Authorization only" in your account settings. semantic-release cannot publish with the default "
Authorization and writes" level.

Please make sure to set the NPM_TOKEN environment variable in your CI with the exact value of the npm token.


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

Is there a way to attempt to retry / reconnect in case of a disconnect?

Perhaps related to #77, but I couldn't find if there's anything that handles a WebSocket onerror or onclose event
(maybe that is in it-ws ?) that would attempt to reestablish a connection.

I think manifestation of this is that if the WebSocket connection to a preload node in js-ipfs is disconnected, there doesn't seem to be any attempt to reconnect via ws?

It would be great if there was some sort of retry mechanism to establish a previously valid connection WS connection..

I thought the issue could be in this library, but not 100% sure, or maybe I'm missing something as well.. (Feel free to close if this is not applicable).

Typescript build error - dial

async dial (ma: Multiaddr, options: DialOptions) {
    log('dialing %s', ma)
    options = options ?? {}

    const socket = await this._connect(ma, options)
    const maConn = socketToMaConn(socket, ma)
    log('new outbound connection %s', maConn.remoteAddr)

    const conn = await options.upgrader.upgradeOutbound(maConn)
    log('outbound connection %s upgraded', maConn.remoteAddr)
    return conn
  }

options = options ?? {} line should probably be removed (which is the line I believe causes a build error) -- this indicates options is optional, which it is not.

An in-range update of multiaddr is breaking the build 🚨

Version 2.2.2 of multiaddr just got published.

Branch Build failing 🚨
Dependency multiaddr
Current Version 2.2.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As multiaddr is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build is in progress Details

  • ❌ ci/circleci Your tests failed on CircleCI Details

Commits

The new version differs by 4 commits .

  • aeb7936 chore: release version v2.2.2
  • c762154 chore: update contributors
  • f56856d chore: update aegir and fix linting
  • c2508b4 docs(readme): flat-square badges from shields.io

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of interface-connection is breaking the build 🚨

Version 0.3.2 of interface-connection just got published.

Branch Build failing 🚨
Dependency interface-connection
Current Version 0.3.1
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As interface-connection is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build is in progress Details

  • ❌ ci/circleci Your tests failed on CircleCI Details

Commits

The new version differs by 3 commits .

  • 7cf11be chore: add engine
  • 239849f chore: update deps
  • a6509fa chore(package): update aegir to version 10.0.0 (#23)

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Use interface-transport tests with a wss multiaddr

For testing this module with a wss multiaddr we need to configure the server properly using a certificate.

const server = https.createServer({
  cert: fs.readFileSync('./test/fixtures/certificate.pem'),
  key: fs.readFileSync('./test/fixtures/key.pem')
})

ws.createListener({ server }, conn => pipe(conn, conn))

After this, and taking into consideration that we will use a self-signed certificate, we also need to provide the option rejectUnauthorized: false to the Websocket instantiation, through passing this option in the ws.dial() call.

The current version of interface-transport does not allow us to configure each test individually, which does not allow us to provide this configuration only if we are using a wss multiaddr, which is mandatory to get these multiaddr.

Emitted 'error' event on Socket instance

events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: connect ENETUNREACH 2604:1380:1:b600::3:4002 - Local (:::0)
    at internalConnect (net.js:923:16)
    at defaultTriggerAsyncIdScope (internal/async_hooks.js:313:12)
    at net.js:1011:9
    at processTicksAndRejections (internal/process/task_queues.js:79:11)
Emitted 'error' event on Socket instance at:
    at emitErrorNT (internal/streams/destroy.js:84:8)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  errno: -101,
  code: 'ENETUNREACH',
  syscall: 'connect',
  address: '2604:1380:1:b600::3',
  port: 4002
}

CC @vasco-santos @jacobheun

An in-range update of interface-connection is breaking the build 🚨

Version 0.3.1 of interface-connection just got published.

Branch Build failing 🚨
Dependency interface-connection
Current Version 0.3.0
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As interface-connection is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • βœ… ci/circleci Your tests passed on CircleCI! Details

  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 4 commits .

  • f7b996f chore: release version v0.3.1
  • 030c52e chore: update contributors
  • 6b2fb83 chore: ^ to ~
  • 26eaf46 chore(package): update aegir to version 9.2.1 (#22)

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

WebSocket Error wss://ws-star.discovery.libp2p.io/socket.io

Hi there :)

I'm currently working on my bachelor's thesis in which I proof that creating WebComponents using OrbitDB is possible. OrbitDB uses ipfs and its experimental pubsub feature, including the transport over WebSockets.

Addresses: {
  Swarm: [
    // Use IPFS dev signal server
    // '/dns4/star-signal.cloud.ipfs.team/wss/p2p-webrtc-star',
    '/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star',
    // Use local signal server
    // '/ip4/127.0.0.1/tcp/1337/ws/p2p-webrtc-star'
  ]
}

In the last couple of days I'm getting a lot of Errors when creating the ipfs node in the browser. WebSocket connection to 'wss://ws-star.discovery.libp2p.io/socket.io/?EIO=3&transport=websocket' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED.

My guess is that the traffic to this endpoint is getting pretty big. Are there any resources on how to setting up an own signaling server? My Professor is really interested in ipfs and its possibilities.
It might be possible to get a signaling server up and running at my college, maybe even a mirror of your whole setup to increase stability.

Any help is much appreciated :)

Crashes when data is not a buffer

/app/node_modules/pull-reader/state.js:18
        throw new Error('data must be a buffer, was: ' + JSON.stringify(data))
        ^

Error: data must be a buffer, was: ""
    at Object.add (/app/node_modules/pull-reader/state.js:18:15)
    at /app/node_modules/pull-reader/index.js:61:15
    at /app/node_modules/pull-reader/index.js:20:7
    at WebSocket.<anonymous> (/app/node_modules/pull-ws/source.js:31:14)
    at WebSocket.onMessage (/app/node_modules/ws/lib/WebSocket.js:442:14)
    at emitTwo (events.js:126:13)
    at WebSocket.emit (events.js:214:7)
    at Receiver.ontext (/app/node_modules/ws/lib/WebSocket.js:841:10)
    at /app/node_modules/ws/lib/Receiver.js:536:18
    at Receiver.applyExtensions (/app/node_modules/ws/lib/Receiver.js:371:5)

Steps to reproduce:

npm install -g wscat
wscat -c host:port
# press return after connection

Instead the server should call Buffer.from(data) on strings or just ignore the data instead of crashing the whole node

An in-range update of interface-transport is breaking the build 🚨

Version 0.3.4 of interface-transport just got published.

Branch Build failing 🚨
Dependency interface-transport
Current Version 0.3.3
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As interface-transport is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build is in progress Details

  • ❌ ci/circleci Your tests failed on CircleCI Details

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Do not require wss when target host is loopback address

This line makes dialling a local node from a webworker or browser over websockets impossible without also setting up WSS which makes writing tests for things a whole lot harder.

This check should be relaxed as the browser will allow regular WS connections to loopback addresses without requiring SSL, since traffic cannot be snooped on by malicious third parties when it does not leave the host machine. Other processes on your computer may snoop, but if that's happening you are already compromised.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.