Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to enable ut_pex? #1322

Closed
muneebm opened this issue Mar 4, 2018 · 3 comments
Closed

How to enable ut_pex? #1322

muneebm opened this issue Mar 4, 2018 · 3 comments

Comments

@muneebm
Copy link

@muneebm muneebm commented Mar 4, 2018

Hi All, ut_pex seems to be by default disabled for browser
// from package.json
"browser": {
"./lib/server.js": false,
"./lib/tcp-pool.js": false,
"bittorrent-dht/client": false,
"fs-chunk-store": "memory-chunk-store",
"load-ip-set": false,
"net": false,
"os": false,
"ut_pex": false
}
And the available options don't have one for enabling ut_pex
{
maxConns: Number, // Max number of connections per torrent (default=55)
nodeId: String|Buffer, // DHT protocol node ID (default=randomly generated)
peerId: String|Buffer, // Wire protocol peer ID (default=randomly generated)
tracker: Boolean|Object, // Enable trackers (default=true), or options object for Tracker
dht: Boolean|Object, // Enable DHT (default=true), or options object for DHT
webSeeds: Boolean // Enable BEP19 web seeds (default=true)
}
Is there any other way to enable ut_pex in webtorrent?

Sorry if it's a noob question and thanks in advance for any help!

@SilentBot1

This comment has been minimized.

Copy link
Member

@SilentBot1 SilentBot1 commented Mar 4, 2018

Hey @muneebm,

As you mentioned, in the package.json the module ut_pex is excluded from being bundled when a script is passed through Browserify. Changing the key ut_pex's value to true in package.json then running Browserify again should be enough to include the ut_pex in the bundle. Once it is included it will be ran on all wires created as is defined here, so no need to run it on each wire yourself.

The module ut_pex was set to not load in the browser when Browserify support was first introduced in this commit. There may have been a reason behind it but it wasn't document, so I would love to hear back if it works without issue after re-enabling it in package.json.

All the best.

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Mar 6, 2018

The ut_pex spec is written assuming that peers can be described by their ip addresses and ports, but this won't work for browser (webrtc) peers. That's why it's disabled.

@feross feross closed this Mar 6, 2018
@muneebm

This comment has been minimized.

Copy link
Author

@muneebm muneebm commented Mar 6, 2018

Thanks to both of you for your responses.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.