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

Commit

Permalink
feat: p2p addrs situation (#82)
Browse files Browse the repository at this point in the history
* chore: update gitignore

* chore: update CI configs

* chore: update deps

* chore: small refactor
  • Loading branch information
daviddias committed Sep 3, 2017
1 parent ef45cc9 commit a54bb83
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 20 deletions.
19 changes: 17 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
**/node_modules/
**/*.log
test/repo-tests*
**/bundle.js

# Logs
logs
*.log

coverage

# Runtime data
pids
*.pid
Expand All @@ -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
17 changes: 8 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
8 changes: 5 additions & 3 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
},
Expand All @@ -61,4 +62,4 @@
"Richard Littauer <richard.littauer@gmail.com>",
"Stephen Whitmore <stephen.whitmore@gmail.com>"
]
}
}
2 changes: 1 addition & 1 deletion src/get-multiaddr.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/listener.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const getMultiaddr = require('./get-multiaddr')

const IPFS_CODE = 421
const CLOSE_TIMEOUT = 2000

function noop () {}

module.exports = (handler) => {
Expand Down

0 comments on commit a54bb83

Please sign in to comment.