theobarrague / fake-bittorrent-client

A Node.js BitTorrent API implementation for testing or cheating on trackers
MIT License
1 stars 0 forks source link

Error : TypeError: urlToHttpOptions is not a function when running in Heroku #3

Closed draeder closed 3 years ago

draeder commented 3 years ago

I built a tracker swarm module that works great locally when using fake-bittorrent-client to test tracker servers. However, when running fake-bittorrent-client in Heroku, I get this error:

Error : TypeError: urlToHttpOptions is not a function when running in Heroku

Any ideas why this might be happening?

draeder commented 3 years ago

I think the issue is here in FakeBittorrentClient.ts:

//var options = urlToHttpOptions(new URL(url)); <-- Change this
var options = new URL(url) //<-- To this

I've tested without urlToHttpOptions and just new URL(url) and it still works fine. Since I'm using new URL() in my module successfully in Heroku, I believe this will fix it.

I'll submit a PR.

theobarrague commented 3 years ago

Nice, thank's you :)