Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upPick an available port instead of crashing with "listen EADDRINUSE" #411
Comments
This comment has been minimized.
This comment has been minimized.
|
This error means that the port WebTorrent wants to use (port 8000) is already in use. This could be from an other instance of WebTorrent, or any another program. You can run WebTorrent on a different port by using the
I'll leave this issue open since we can do better here -- by either providing a friendlier error, or preferably, automatically picking an available port. |
This comment has been minimized.
This comment has been minimized.
|
Thanks! |
This comment has been minimized.
This comment has been minimized.
|
Leaving this issue open until we support automatically picking an available port instead of crashing. |
This comment has been minimized.
This comment has been minimized.
|
@feross I'm whiling to help on this. |
This comment has been minimized.
This comment has been minimized.
|
@Stiveknx It's not too much work actually, it can be done in just a few lines of code. https://github.com/gillesdemey/grop/blob/master/index.js There are countless modules on npm already, though it looks like node-portscanner has a few more bells and whistles. |
This comment has been minimized.
This comment has been minimized.
|
@Stiveknx Cool, happy to accept a PR from you that implements this. You might not need to use an open port finder, but instead pass @gillesdemey |
…r "listen EACCES" Fixes: webtorrent#411
…r "listen EACCES" Fixes: webtorrent#411
…r "listen EACCES" Fixes: webtorrent#411
This comment has been minimized.
This comment has been minimized.
|
I made a little contribution on this, I believe this is what you were talking about... |
…r "listen EACCES" Fixes: webtorrent#411
…r "listen EACCES" Fixes: webtorrent#411
DEBUG INFO: webtorrent 0.60.1, node v0.12.7, darwin x64, exit 1
events.js:85
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE
at exports._errnoException (util.js:746:11)
at Server._listen2 (net.js:1156:14)
at listen (net.js:1182:10)
at Server.listen (net.js:1267:5)
at runDownload (/opt/local/lib/node_modules/webtorrent/bin/cmd.js:313:10)
at Object. (/opt/local/lib/node_modules/webtorrent/bin/cmd.js:147:3)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)