Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

chore: update deps #124

Merged
merged 3 commits into from
Apr 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .aegir.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const multiaddr = require('multiaddr')
const { Multiaddr } = require('multiaddr')
const pipe = require('it-pipe')
const WS = require('./src')

Expand All @@ -12,7 +12,7 @@ let listener

async function before () {
const ws = new WS({ upgrader: mockUpgrader })
const ma = multiaddr('/ip4/127.0.0.1/tcp/9095/ws')
const ma = new Multiaddr('/ip4/127.0.0.1/tcp/9095/ws')
listener = ws.createListener(conn => pipe(conn, conn))
await listener.listen(ma)
listener.on('error', console.error)
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: ci
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm install
- run: npx aegir lint
- run: npx aegir dep-check -- -i wrtc -i electron-webrtc
- run: npx aegir build --no-types
test-node:
needs: check
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
node: [14, 15]
fail-fast: true
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: npm install
- run: npx nyc --reporter=lcov aegir test -t node -- --bail
- uses: codecov/codecov-action@v1
test-chrome:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm install
- run: npx aegir test -t browser -t webworker --bail
test-firefox:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm install
- run: npx aegir test -t browser -t webworker --bail -- --browsers FirefoxHeadless
48 changes: 0 additions & 48 deletions .travis.yml

This file was deleted.

3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
[![Circle CI](https://circleci.com/gh/libp2p/js-libp2p-websockets.svg?style=svg)](https://circleci.com/gh/libp2p/js-libp2p-websockets)
[![Dependency Status](https://david-dm.org/libp2p/js-libp2p-websockets.svg?style=flat-square)](https://david-dm.org/libp2p/js-libp2p-websockets)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)
![](https://img.shields.io/badge/npm-%3E%3D3.0.0-orange.svg?style=flat-square)
![](https://img.shields.io/badge/Node.js-%3E%3D4.0.0-orange.svg?style=flat-square)
![](https://img.shields.io/badge/Node.js-%3E%3D14.0.0-orange.svg?style=flat-square)

[![](https://raw.githubusercontent.com/libp2p/interface-transport/master/img/badge.png)](https://github.com/libp2p/interface-transport)
[![](https://raw.githubusercontent.com/libp2p/interface-connection/master/img/badge.png)](https://github.com/libp2p/interface-connection)
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,25 @@
"dependencies": {
"abortable-iterator": "^3.0.0",
"class-is": "^1.1.0",
"debug": "^4.2.0",
"debug": "^4.3.1",
"err-code": "^3.0.1",
"ipfs-utils": "^6.0.1",
"ipfs-utils": "^6.0.6",
"it-ws": "^4.0.0",
"libp2p-utils": "^0.2.1",
"mafmt": "^8.0.1",
"multiaddr": "^8.1.1",
"libp2p-utils": "^0.3.0",
"mafmt": "^9.0.0",
"multiaddr": "^9.0.1",
"multiaddr-to-uri": "^6.0.0",
"p-defer": "^3.0.0",
"p-timeout": "^4.1.0"
},
"devDependencies": {
"abort-controller": "^3.0.0",
"aegir": "^32.2.0",
"bl": "^4.0.0",
"aegir": "^33.0.0",
"bl": "^5.0.0",
"is-loopback-addr": "^1.0.1",
"it-goodbye": "^2.0.1",
"it-pipe": "^1.0.1",
"libp2p-interfaces": "^0.8.3",
"it-goodbye": "^3.0.0",
"it-pipe": "^1.1.0",
"libp2p-interfaces": "^0.9.0",
"streaming-iterables": "^5.0.2",
"uint8arrays": "^2.1.2",
"util": "^0.12.3"
Expand Down
4 changes: 4 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ const createListener = require('./listener')
const toConnection = require('./socket-to-conn')
const filters = require('./filters')

/**
* @typedef {import('multiaddr').Multiaddr} Multiaddr
*/

/**
* @class WebSockets
*/
Expand Down
4 changes: 2 additions & 2 deletions src/listener.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const EventEmitter = require('events')
const os = require('os')
const multiaddr = require('multiaddr')
const { Multiaddr } = require('multiaddr')
const { createServer } = require('it-ws')
const debug = require('debug')
const log = debug('libp2p:websockets:listener')
Expand Down Expand Up @@ -78,7 +78,7 @@ module.exports = ({ handler, upgrader }, options = {}) => {
Object.keys(netInterfaces).forEach((niKey) => {
netInterfaces[niKey].forEach((ni) => {
if (ni.family === 'IPv4') {
multiaddrs.push(multiaddr(m.toString().replace('0.0.0.0', ni.address)))
multiaddrs.push(new Multiaddr(m.toString().replace('0.0.0.0', ni.address)))
}
})
})
Expand Down
12 changes: 6 additions & 6 deletions test/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

const { expect } = require('aegir/utils/chai')

const multiaddr = require('multiaddr')
const { Multiaddr } = require('multiaddr')
const pipe = require('it-pipe')
const goodbye = require('it-goodbye')
const { collect, take } = require('streaming-iterables')
Expand All @@ -17,7 +17,7 @@ const mockUpgrader = {
}

describe('libp2p-websockets', () => {
const ma = multiaddr('/ip4/127.0.0.1/tcp/9095/ws')
const ma = new Multiaddr('/ip4/127.0.0.1/tcp/9095/ws')
let ws
let conn

Expand All @@ -35,10 +35,10 @@ describe('libp2p-websockets', () => {
})

it('should filter out no DNS websocket addresses', function () {
const ma1 = multiaddr('/ip4/127.0.0.1/tcp/80/ws')
const ma2 = multiaddr('/ip4/127.0.0.1/tcp/443/wss')
const ma3 = multiaddr('/ip6/::1/tcp/80/ws')
const ma4 = multiaddr('/ip6/::1/tcp/443/wss')
const ma1 = new Multiaddr('/ip4/127.0.0.1/tcp/80/ws')
const ma2 = new Multiaddr('/ip4/127.0.0.1/tcp/443/wss')
const ma3 = new Multiaddr('/ip6/::1/tcp/80/ws')
const ma4 = new Multiaddr('/ip6/::1/tcp/443/wss')

const valid = ws.filter([ma1, ma2, ma3, ma4])
expect(valid.length).to.equal(0)
Expand Down
10 changes: 5 additions & 5 deletions test/compliance.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'use strict'

const tests = require('libp2p-interfaces/src/transport/tests')
const multiaddr = require('multiaddr')
const { Multiaddr } = require('multiaddr')
const http = require('http')
const WS = require('../src')
const filters = require('../src/filters')
Expand All @@ -12,10 +12,10 @@ describe('interface-transport compliance', () => {
async setup ({ upgrader }) { // eslint-disable-line require-await
const ws = new WS({ upgrader, filter: filters.all })
const addrs = [
multiaddr('/ip4/127.0.0.1/tcp/9091/ws'),
multiaddr('/ip4/127.0.0.1/tcp/9092/ws'),
multiaddr('/dns4/ipfs.io/tcp/9092/ws'),
multiaddr('/dns4/ipfs.io/tcp/9092/wss')
new Multiaddr('/ip4/127.0.0.1/tcp/9091/ws'),
new Multiaddr('/ip4/127.0.0.1/tcp/9092/ws'),
new Multiaddr('/dns4/ipfs.io/tcp/9092/ws'),
new Multiaddr('/dns4/ipfs.io/tcp/9092/wss')
]

let delayMs = 0
Expand Down
Loading