feat/add-upnp-nat-manager feat: add uPnP nat manager

Adds a really basic nat manager that attempts to use UPnP to punch
a hole through your router for any IPV4 tcp addresses you have
configured.

Adds any configured addresses to the node's observed addresses list
and adds observed addresses to `libp2p.multiaddrs` so we exchange
them with peers when performing `identify` and people can dial you.

Adds configuration options under `config.nat`

Hole punching is async to not affect start up time.

Alex Potsides avatar Alex Potsides

Push event #3828 failed

  • Ran for
  • Total time
libp2p/js-libp2p:.travis.yml@d240b9c
language: node_js
cache: npm
stages:
  - check
  - test
  - cov

node_js:
  - 'lts/*'
  - '14'

os:
  - linux
  - osx

script: npx nyc -s npm run test:node -- --bail
after_success: npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov

jobs:
  include:
    - stage: check
      script:
        - npx aegir build --bundlesize
        # Remove pull libs once ping is async
        - npx aegir dep-check -- -i pull-handshake -i pull-stream
        - npm run lint

    - stage: test
      name: chrome
      addons:
        chrome: stable
      script:
        - npx aegir test -t browser -t webworker

    - stage: test
      name: firefox
      addons:
        firefox: latest
      script:
        - npx aegir test -t browser -t webworker -- --browsers FirefoxHeadless

    - stage: test
      name: interop
      script:
        - cd node_modules/interop-libp2p
        - npm install
        - LIBP2P_JS=${TRAVIS_BUILD_DIR}/src/index.js npx aegir test -t node --bail

    - stage: test
      if: type = pull_request
      name: example - auto-relay
      script:
        - cd examples
        - npm install
        - npm run test -- auto-relay

notifications:
  email: false
Build Config
{
  "language": "node_js",
  "os": [
    "linux",
    "osx"
  ],
  "dist": "xenial",
  "cache": {
    "npm": true
  },
  "stages": [
    {
      "name": "check"
    },
    {
      "name": "test"
    },
    {
      "name": "cov"
    }
  ],
  "node_js": [
    "lts/*",
    "14"
  ],
  "script": [
    "npx nyc -s npm run test:node -- --bail"
  ],
  "after_success": [
    "npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov"
  ],
  "jobs": {
    "include": [
      {
        "stage": "check",
        "script": [
          "npx aegir build --bundlesize",
          "npx aegir dep-check -- -i pull-handshake -i pull-stream",
          "npm run lint"
        ]
      },
      {
        "stage": "test",
        "name": "chrome",
        "addons": {
          "chrome": "stable"
        },
        "script": [
          "npx aegir test -t browser -t webworker"
        ]
      },
      {
        "stage": "test",
        "name": "firefox",
        "addons": {
          "firefox": "latest"
        },
        "script": [
          "npx aegir test -t browser -t webworker -- --browsers FirefoxHeadless"
        ]
      },
      {
        "stage": "test",
        "name": "interop",
        "script": [
          "cd node_modules/interop-libp2p",
          "npm install",
          "LIBP2P_JS=${TRAVIS_BUILD_DIR}/src/index.js npx aegir test -t node --bail"
        ]
      },
      {
        "stage": "test",
        "if": "type = pull_request",
        "name": "example - auto-relay",
        "script": [
          "cd examples",
          "npm install",
          "npm run test -- auto-relay"
        ]
      }
    ]
  },
  "notifications": {
    "email": [
      {
        "enabled": false
      }
    ]
  }
}