storj-archived / core

Deprecated. Implementation of the Storj v2 protocol for Node.js.
https://storj.io
Other
396 stars 88 forks source link

UPNP does not open UDP Ports, Kad seems to need udp #196

Closed BlackDuck888 closed 8 years ago

BlackDuck888 commented 8 years ago

Package Versions

Replace the values below using the output from npm list storj.

/usr/local/lib
├── storj@1.2.8
├─┬ storj-bridge@0.8.4
│ └── storj@1.2.6
└─┬ storjshare-cli@4.0.4
  └── storj@1.2.8

Replace the values below using the output from node --version.

v4.4.5

Expected Behavior

I expect that UPNP is used to open all needed ports and protocolls.

Actual Behavior

UPNP is used to open only tcp ports right now. In https://github.com/kadtools/kad/blob/86e29eef2ae3aec66d7502054c37cea5c9f0d78e/test/router.unit.js#L108 it look like for me, that udp is used for communication. UPNP users will not reached in this case, if i am correct.

{"level":"warn","message":"you are not bound to a public address, trying traversal strategies...","timestamp":"2016-06-21T06:45:29.855Z"}
{"level":"info","message":"you are configured to tunnel up to 3 connections","timestamp":"2016-06-21T06:45:29.858Z"}
{"level":"info","message":"successfully traversed NAT via UPnP","timestamp":"2016-06-21T06:45:30.097Z"}
{"level":"info","message":"tunnel server bound and port mapped: 42944","timestamp":"2016-06-21T06:45:30.098Z"}
{"level":"info","message":"successfully traversed NAT via UPnP","timestamp":"2016-06-21T06:45:30.099Z"}
{"level":"info","message":"node created with nodeID f02dea09a100c14b604228fe4fc8425531d353a5","timestamp":"2016-06-21T06:45:30.103Z"}

shared ports via upnp

Steps to Reproduce

Please include the steps the reproduce the issue, numbered below. Include as much detail as possible.

  1. Start storjshare with upnp settings
  2. Watch your firewall what is set.
tacticalchihuahua commented 8 years ago

Kad has a pluggable transport adapter interface. It ships with support for UDP, TCP, and HTTP. The line you referenced from the test suite happens to be testing against the UDP adapter. We use our own custom transport adapter that extends kad's HTTP adapter.

Reference: