feat: p2p addrs situation (#82)

* chore: update gitignore

* chore: update CI configs

* chore: update deps

* chore: small refactor
This commit is contained in:
David Dias 2017-09-03 10:01:16 +01:00 committed by GitHub
parent ef45cc9a34
commit a54bb83657
6 changed files with 38 additions and 20 deletions

19
.gitignore vendored
View File

@ -1,7 +1,14 @@
**/node_modules/
**/*.log
test/repo-tests*
**/bundle.js
# Logs
logs
*.log
coverage
# Runtime data
pids
*.pid
@ -19,9 +26,17 @@ coverage
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
build
# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
lib
dist
test/test-data/go-ipfs-repo/LOCK
test/test-data/go-ipfs-repo/LOG
test/test-data/go-ipfs-repo/LOG.old
# while testing npm5
package-lock.json

View File

@ -1,22 +1,20 @@
sudo: false
language: node_js
matrix:
include:
- node_js: 4
env: CXX=g++-4.8
- node_js: 6
env: CXX=g++-4.8
- node_js: stable
- node_js: 8
env: CXX=g++-4.8
# Make sure we have new NPM.
before_install:
- npm install -g npm
# - node_js: stable
# env: CXX=g++-4.8
script:
- npm run lint
- npm test
- npm run test
- npm run coverage
- make test
before_script:
- export DISPLAY=:99.0
@ -26,8 +24,9 @@ after_success:
- npm run coverage-publish
addons:
firefox: 'latest'
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
- g++-4.8

View File

@ -5,8 +5,10 @@ machine:
dependencies:
pre:
- google-chrome --version
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
- sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
- curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
- sudo dpkg -i google-chrome.deb || true
- sudo apt-get update
- sudo apt-get --only-upgrade install google-chrome-stable
- sudo apt-get install -f
- sudo apt-get install --only-upgrade lsb-base
- sudo dpkg -i google-chrome.deb
- google-chrome --version

View File

@ -30,11 +30,12 @@
},
"homepage": "https://github.com/libp2p/js-libp2p-tcp",
"engines": {
"node": ">=4.0.0"
"node": ">=6.0.0",
"npm": ">=3.0.0"
},
"devDependencies": {
"aegir": "^11.0.2",
"chai": "^4.1.0",
"chai": "^4.1.2",
"dirty-chai": "^2.0.1",
"interface-transport": "~0.3.5",
"lodash.isfunction": "^3.0.8",
@ -46,8 +47,8 @@
"ip-address": "^5.8.8",
"lodash.includes": "^4.3.0",
"lodash.isfunction": "^3.0.8",
"mafmt": "^2.1.8",
"multiaddr": "^2.3.0",
"mafmt": "^3.0.0",
"multiaddr": "^3.0.0",
"once": "^1.4.0",
"stream-to-pull-stream": "^1.7.2"
},
@ -61,4 +62,4 @@
"Richard Littauer <richard.littauer@gmail.com>",
"Stephen Whitmore <stephen.whitmore@gmail.com>"
]
}
}

View File

@ -4,7 +4,7 @@ const multiaddr = require('multiaddr')
const Address6 = require('ip-address').Address6
module.exports = (socket) => {
var mh
let mh
if (socket.remoteFamily === 'IPv6') {
var addr = new Address6(socket.remoteAddress)

View File

@ -14,6 +14,7 @@ const getMultiaddr = require('./get-multiaddr')
const IPFS_CODE = 421
const CLOSE_TIMEOUT = 2000
function noop () {}
module.exports = (handler) => {