diff --git a/.gitignore b/.gitignore index 8cb3dc0..c2ba637 100644 --- a/.gitignore +++ b/.gitignore @@ -33,4 +33,3 @@ node_modules .node_repl_history dist -lib \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index dd9e44e..2957a4b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,17 @@ sudo: false language: node_js -node_js: - - 4 - - 5 - - stable + +matrix: + include: + - node_js: 4 + env: CXX=g++-4.8 + - node_js: 6 + env: + - SAUCE=true + - CXX=g++-4.8 + - node_js: "stable" + env: + - CXX=g++-4.8 # Make sure we have new NPM. before_install: @@ -14,12 +22,17 @@ script: - npm test - npm run coverage -addons: - firefox: 'latest' - before_script: - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start after_success: - npm run coverage-publish + +addons: + firefox: latest + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-4.8 diff --git a/README.md b/README.md index d3190ab..d3045b5 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,14 @@ [![Travis CI](https://travis-ci.org/libp2p/js-libp2p-websockets.svg?branch=master)](https://travis-ci.org/libp2p/js-libp2p-websockets) [![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) + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/js-libp2p-websockets.svg)](https://saucelabs.com/u/js-libp2p-websockets) ![](https://raw.githubusercontent.com/libp2p/interface-connection/master/img/badge.png) ![](https://raw.githubusercontent.com/libp2p/interface-transport/master/img/badge.png) + > JavaScript implementation of the WebSockets module that libp2p uses and that implements the interface-transport interface ## Description diff --git a/package.json b/package.json index 48c26c0..5a417f5 100644 --- a/package.json +++ b/package.json @@ -2,8 +2,7 @@ "name": "libp2p-websockets", "version": "0.8.1", "description": "JavaScript implementation of the WebSockets module that libp2p uses and that implements the interface-transport spec", - "main": "lib/index.js", - "jsnext:main": "src/index.js", + "main": "src/index.js", "scripts": { "lint": "aegir-lint", "test": "gulp test", @@ -16,6 +15,9 @@ "coverage": "gulp coverage", "coverage-publish": "aegir-coverage publish" }, + "browser": { + "pull-ws/server": false + }, "pre-commit": [ "lint", "test" @@ -34,21 +36,20 @@ }, "homepage": "https://github.com/libp2p/js-libp2p-websockets#readme", "dependencies": { - "detect-node": "^2.0.3", - "interface-connection": "^0.2.1", + "interface-connection": "^0.3.0", "lodash.contains": "^2.4.3", - "mafmt": "^2.1.1", - "pull-ws": "^3.2.3" + "mafmt": "^2.1.2", + "pull-ws": "^3.2.8" }, "devDependencies": { - "aegir": "^8.0.0", + "aegir": "^9.0.1", "chai": "^3.5.0", "gulp": "^3.9.1", "interface-transport": "^0.3.3", - "multiaddr": "^2.0.2", + "multiaddr": "^2.0.3", "pre-commit": "^1.1.3", "pull-goodbye": "0.0.1", - "pull-stream": "^3.4.3" + "pull-stream": "^3.5.0" }, "contributors": [ "David Dias ", @@ -56,4 +57,4 @@ "dignifiedquire ", "greenkeeperio-bot " ] -} \ No newline at end of file +} diff --git a/src/listener.js b/src/listener.js index baa4337..c2cfc56 100644 --- a/src/listener.js +++ b/src/listener.js @@ -1,16 +1,13 @@ 'use strict' -const isNode = require('detect-node') const Connection = require('interface-connection').Connection const contains = require('lodash.contains') // const IPFS_CODE = 421 -let createServer +let createServer = require('pull-ws/server') -if (isNode) { - createServer = require('pull-ws/server') -} else { +if (!createServer) { createServer = () => {} }