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

Tracker object doesn't work on client opts #2376

Open
injaan opened this issue Sep 18, 2022 · 5 comments
Open

Tracker object doesn't work on client opts #2376

injaan opened this issue Sep 18, 2022 · 5 comments
Labels

Comments

@injaan
Copy link

injaan commented Sep 18, 2022

What version of this package are you using?
1.8.30

What operating system, Node.js, and npm version?
Windows 10, nodejs: v16.13.1, npm: 8.1.2

What happened?
Tried to initiate new client with custom opts and provided tracker object like following code

const WebTorrent = require('webtorrent');
const trackerObject = {
    announce: [
        'udp://localhost:8000'
    ]
}
const client = new WebTorrent({
    tracker: trackerObject
});

client.seed('./uploads/video.mp4', (torrent)=>{
    console.log(torrent.announce)
});

and console logged torrent files announce addresses it gives me default addresses instead my provided custom one

image

@gauravsaini
Copy link

gauravsaini commented Dec 6, 2022

const WebTorrent = require('webtorrent');
const trackerObject = {
    announce: 'udp://localhost:8000'
};
const client = new WebTorrent({
    tracker: trackerObject
});

client.seed('./uploads/video.mp4', (torrent) => {
    console.log(torrent.announce);
});

Try this instead

@injaan
Copy link
Author

injaan commented Dec 7, 2022

@gauravsaini same result

@gauravsaini
Copy link

gauravsaini commented Dec 10, 2022

@injaan

const announceUrls = [
'udp://localhost:8000',
// ...additional announce URLs here
];

const client = new Client({
// other options here...
announce: announceUrls
});

@qjinle
Copy link

qjinle commented Dec 13, 2022

I had the same problem

@LisAlexander1
Copy link

now it works like this

client.seed('./seed-me.txt', { announce: ['ws://[::1]:5000'] }, (torrent) => {})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants